Package org.jbpm.workflow.core.node

Examples of org.jbpm.workflow.core.node.StartNode


    }

    public static RuleFlowProcess newProcessWithOneSubProcess(String processId, String subProcessId) {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId(processId);
        StartNode startNode = new StartNode();
        startNode.setName("Start");
        startNode.setId(1);
        SubProcessNode subProcessNode = new SubProcessNode();
        subProcessNode.setId(2);
        subProcessNode.setProcessId(subProcessId);
        subProcessNode.setName("subProcess");
        EndNode endNode = new EndNode();
View Full Code Here


        process.addNode(endNode);
        return process;
    }

    public static RuleFlowProcess newShortestProcess(String processId) {
        StartNode startNode = new StartNode();
        startNode.setName("Start");
        startNode.setId(1);
        EndNode endNode = new EndNode();
        endNode.setName("EndNode");
        endNode.setId(2);
        connect(startNode, endNode);
        RuleFlowProcess process = new RuleFlowProcess();
View Full Code Here

    private static Package getProcessWorkItems() {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId( "org.drools.test.TestProcess" );
        process.setName( "TestProcess" );
        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        ActionNode actionNode = new ActionNode();
        actionNode.setId( 2 );
        actionNode.setName( "Action" );
        DroolsConsequenceAction action = new DroolsConsequenceAction();
View Full Code Here

    private static Package getProcessSubProcess() {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId( "org.drools.test.ProcessSubProcess" );
        process.setName( "ProcessSubProcess" );
        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        ActionNode actionNode = new ActionNode();
        actionNode.setId( 2 );
        actionNode.setName( "Action" );
        DroolsConsequenceAction action = new DroolsConsequenceAction();
        action.setDialect( "java" );
        action.setConsequence( "System.out.println(\"Executed action\");" );
        actionNode.setAction( action );
        process.addNode( actionNode );
        new ConnectionImpl( start,
                            Node.CONNECTION_DEFAULT_TYPE,
                            actionNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        SubProcessNode subProcessNode = new SubProcessNode();
        subProcessNode.setId( 3 );
        subProcessNode.setName( "SubProcess" );
        subProcessNode.setProcessId( "org.drools.test.SubProcess" );
        process.addNode( subProcessNode );
        new ConnectionImpl( actionNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            subProcessNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        EndNode end = new EndNode();
        end.setId( 4 );
        end.setName( "End" );
        process.addNode( end );
        new ConnectionImpl( subProcessNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            end,
                            Node.CONNECTION_DEFAULT_TYPE );

        PackageBuilder packageBuilder = new PackageBuilder();
        ProcessBuilderImpl processBuilder = new ProcessBuilderImpl( packageBuilder );
        processBuilder.buildProcess( process,
                                     null );

        process = new RuleFlowProcess();
        process.setId( "org.drools.test.SubProcess" );
        process.setName( "SubProcess" );
        process.setPackageName( "org.drools.test" );
        start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        actionNode = new ActionNode();
        actionNode.setId( 2 );
        actionNode.setName( "Action" );
        action = new DroolsConsequenceAction();
View Full Code Here

    private static Package getProcessTimer() {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId( "org.drools.test.ProcessTimer" );
        process.setName( "ProcessTimer" );
        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        TimerNode timerNode = new TimerNode();
        timerNode.setId( 2 );
        timerNode.setName( "Timer" );
        Timer timer = new Timer();
View Full Code Here

    private static Package getProcessTimer2() {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId( "org.drools.test.ProcessTimer2" );
        process.setName( "ProcessTimer2" );
        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        TimerNode timerNode = new TimerNode();
        timerNode.setId( 2 );
        timerNode.setName( "Timer" );
        Timer timer = new Timer();
View Full Code Here

        if ( process == null ) {
            throw new IllegalArgumentException( "Could not read process" );
        }
        log.debug( "Processing " + process.getId() );
        result = new HashMap<String, String[]>();
        StartNode start = process.getStart();
        Node target = start.getTo().getTo();
        if ( target instanceof Split ) {
            Split split = (Split) target;
            for ( Connection connection : split.getDefaultOutgoingConnections() ) {
                Constraint constraint = split.getConstraint( connection );
                if ( constraint != null ) {
View Full Code Here

        isr.close();
        if ( process == null ) {
            throw new IllegalArgumentException( "Could not read process" );
        } else {
            log.debug( "Processing " + process.getId() );
            StartNode start = process.getStart();
            Node target = start.getTo().getTo();
            if ( target instanceof Split ) {
                Split split = (Split) target;
                for ( Connection connection : split.getDefaultOutgoingConnections() ) {
                    String s = constraints.get( XmlBPMNProcessDumper.getUniqueNodeId( connection.getTo() ) );
                    if ( s != null ) {
View Full Code Here

        testCode +=
          "        // --> triggering each element in the collection:\n";
        boolean done = true;
          for (Node node: compositeNode.getNodes()) {
          if (node instanceof StartNode) {
            StartNode startNode = (StartNode) node;
            if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) {
              done = processNodes(name, startNode.getTo().getTo(), testCode, cases, ongoingCases);
              break;
            }
          }
          }
          if (done) {
            for (Map.Entry<String, String> c: cases.entrySet()) {
              if (c.getKey().startsWith(name)) {
                cases.put(c.getKey(), c.getValue() +
                    "        // <-- do this for one element in the collection:\n");
              }
            }
            return true;
          } else {
            if (ongoingCases.size() == 1) {
              testCode = ongoingCases.values().iterator().next() +
              "        // <-- do this for each element in the collection:\n";
              return processNodes(name + "Implicit", ((NodeImpl) currentNode).getTo().getTo(), testCode, cases, ongoingCases);
            } else {
              throw new IllegalArgumentException("Could not create implicit case: " + ongoingCases.size());
            }
          }
      } else if (currentNode instanceof CompositeNode) {
        CompositeNode compositeNode = (CompositeNode) currentNode;
        boolean done = true;
          for (Node node: compositeNode.getNodes()) {
          if (node instanceof StartNode) {
            StartNode startNode = (StartNode) node;
            if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) {
              done = processNodes(name, startNode.getTo().getTo(), testCode, cases, ongoingCases);
              break;
            }
          }
          }
          if (done) {
View Full Code Here

    private static Package getProcessWorkItems() {
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId( "org.drools.test.TestProcess" );
        process.setName( "TestProcess" );
        process.setPackageName( "org.drools.test" );
        StartNode start = new StartNode();
        start.setId( 1 );
        start.setName( "Start" );
        process.addNode( start );
        ActionNode actionNode = new ActionNode();
        actionNode.setId( 2 );
        actionNode.setName( "Action" );
        DroolsConsequenceAction action = new DroolsConsequenceAction();
View Full Code Here

TOP

Related Classes of org.jbpm.workflow.core.node.StartNode

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.