Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.RuleFlowContentModel


    }

    private static ElementContainerTransferNode createRuleFlowContentModelTransferNode(Node[] nodes) {

        ElementContainerTransferNode fetn = new ElementContainerTransferNode();
        RuleFlowContentModel model = new RuleFlowContentModel();

        List<TransferNode> transferNodes = createNodesAndConnections( nodes,
                                                                      model );

        model.setNodes( transferNodes );
        fetn.setContentModel( model );

        return fetn;
    }
View Full Code Here


                                     AssetItem item) throws SerializableException {

        RuleFlowProcess process = readProcess( new ByteArrayInputStream( item.getContent().getBytes() ) );

        if ( process != null ) {
            RuleFlowContentModel content = RuleFlowContentModelBuilder.createModel( process );
            content.setXml( item.getContent() );
            asset.content = content;
        } else if ( process == null && !"".equals( item.getContent() ) ) {
            asset.content = new RuleFlowContentModel();
            //
            //
            // Migrate v4 ruleflows to v5
            // All we can do is put the old drools 4 rfm back as the xml so
            // that we can at least rebuild the package with it if the
View Full Code Here

    }

    public void storeAssetContent(RuleAsset asset,
                                  AssetItem repoAsset) throws SerializableException {

        RuleFlowContentModel content = (RuleFlowContentModel) asset.content;

        //
        // Migrate v4 ruleflows to v5
        // Added guards to check for nulls in the case where the ruleflows
        // have not been migrated from drools 4 to 5.
        //
        if ( content != null ) {
            if ( content.getXml() != null ) {
                RuleFlowProcess process = readProcess( new ByteArrayInputStream( content.getXml().getBytes() ) );

                if ( process != null ) {
                    RuleFlowProcessBuilder.updateProcess( process,
                                                          content.getNodes() );

                    XmlRuleFlowProcessDumper dumper = XmlRuleFlowProcessDumper.INSTANCE;
                    String out = dumper.dump( process );

                    repoAsset.updateContent( out );
                } else {
                    //
                    // Migrate v4 ruleflows to v5
                    // Put the old contents back as there is no updating possible
                    //
                    repoAsset.updateContent( content.getXml() );
                }
            }
        }
    }
View Full Code Here

                                     AssetItem item) throws SerializationException {

        RuleFlowProcess process = readProcess( new ByteArrayInputStream( item.getContent().getBytes() ) );

        if ( process != null ) {
            RuleFlowContentModel content = RuleFlowContentModelBuilder.createModel( process );
            content.setXml( item.getContent() );
            asset.content = content;
        } else if ( process == null && !"".equals( item.getContent() ) ) {
            asset.content = new RuleFlowContentModel();
            //
            //
            // Migrate v4 ruleflows to v5
            // All we can do is put the old drools 4 rfm back as the xml so
            // that we can at least rebuild the package with it if the
View Full Code Here

    }

    public void storeAssetContent(RuleAsset asset,
                                  AssetItem repoAsset) throws SerializationException {

        RuleFlowContentModel content = (RuleFlowContentModel) asset.content;

        //
        // Migrate v4 ruleflows to v5
        // Added guards to check for nulls in the case where the ruleflows
        // have not been migrated from drools 4 to 5.
        //
        if ( content != null ) {
            if ( content.getXml() != null ) {
                RuleFlowProcess process = readProcess( new ByteArrayInputStream( content.getXml().getBytes() ) );

                if ( process != null ) {
                    RuleFlowProcessBuilder.updateProcess( process,
                                                          content.getNodes() );

                    XmlRuleFlowProcessDumper dumper = XmlRuleFlowProcessDumper.INSTANCE;
                    String out = dumper.dump( process );

                    repoAsset.updateContent( out );
                } else {
                    //
                    // Migrate v4 ruleflows to v5
                    // Put the old contents back as there is no updating possible
                    //
                    repoAsset.updateContent( content.getXml() );
                }
            }
        }
    }
View Full Code Here

        //we replace the model by the new model:
        String s = callSave(((IFrameElement)
                ((com.google.gwt.dom.client.Element)
                        frame.getElement())).getContentDocument());
        if (asset.content == null) {
            asset.content = new RuleFlowContentModel();
        }
        ((RuleFlowContentModel) asset.content).setXml(null);
      ((RuleFlowContentModel) asset.content).setJson(s);
    }
View Full Code Here

    public void retrieveAssetContent(RuleAsset asset,
                                     PackageItem pkg,
                                     AssetItem item) throws SerializationException {
        RuleFlowProcess process = readProcess( new ByteArrayInputStream( item.getContent().getBytes() ) );
        if ( process != null ) {
            RuleFlowContentModel content = RuleFlowContentModelBuilder.createModel( process );
            content.setXml( item.getContent() );
            asset.content = content;
    } else {
      // we are very fault tolerant
      RuleFlowContentModel content = new RuleFlowContentModel();
      content.setXml(item.getContent());
      asset.content = content;
    }
    }
View Full Code Here

        return process;
    }

    public void storeAssetContent(RuleAsset asset,
                                  AssetItem repoAsset) throws SerializationException {
      RuleFlowContentModel content = (RuleFlowContentModel) asset.content;
      System.out.println(content);
        //
        // Migrate v4 ruleflows to v5
        // Added guards to check for nulls in the case where the ruleflows
        // have not been migrated from drools 4 to 5.
        //
        if ( content != null ) {
            if ( content.getXml() != null ) {
                RuleFlowProcess process = readProcess( new ByteArrayInputStream( content.getXml().getBytes() ) );

                if ( process != null ) {
                    RuleFlowProcessBuilder.updateProcess( process,
                                                          content.getNodes() );

                    XmlRuleFlowProcessDumper dumper = XmlRuleFlowProcessDumper.INSTANCE;
                    String out = dumper.dump( process );

                    repoAsset.updateContent( out );
                } else {
                    //
                    // Migrate v4 ruleflows to v5
                    // Put the old contents back as there is no updating possible
                    //
                    repoAsset.updateContent( content.getXml() );
                }
            }
            if ( content.getJson() != null) {
              try {
                String xml = serialize( "http://localhost:8080/designer/bpmn2_0serialization", content.getJson());
                System.out.println("xml = " + xml);
                repoAsset.updateContent(xml);
              } catch (Exception e) {
                log.error(e.getMessage(), e);
              }
View Full Code Here

        for ( RuleFlowBaseNode subNode : node.getNodes().values() ) {
            baseNodes.add( createNode( subNode ) );
        }

        RuleFlowContentModel model = new RuleFlowContentModel();
        model.setNodes( baseNodes );
        fetn.setContentModel( model );

        return fetn;
    }
View Full Code Here

    LoadingPopup.close();
  }

  private void initRuleflowViewer() {
    RuleFlowContentModel rfcm = (RuleFlowContentModel) asset.content;

    if (rfcm != null && rfcm.getXml() != null && rfcm.getNodes() != null) {
      try {

        parameterPanel = new Panel();
        parameterPanel.setCollapsible(true);
        parameterPanel.setTitle(constants.Parameters());

        FormStyleLayout parametersForm = new FormStyleLayout();
        parametersForm.setHeight("120px"); // NON-NLS
        parameterPanel.add(parametersForm);

        ruleFlowViewer = new RuleFlowViewer(rfcm, parametersForm);

      } catch (Exception e) {
        Window.alert(e.toString());
      }
    } else if (rfcm != null && rfcm.getXml() == null) {

      // If the XML is not set there was some problem when the diagram was
      // created.
      Window
          .alert(constants
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.RuleFlowContentModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.