Package org.drools.workflow.core.impl

Examples of org.drools.workflow.core.impl.ConnectionImpl


        SubProcessNode subProcessNode = new SubProcessNode();
        subProcessNode.setName("SubProcessNode");
        subProcessNode.setId(3);
        subProcessNode.setProcessId("org.drools.process.subprocess");
        process.addNode(subProcessNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            subProcessNode, Node.CONNECTION_DEFAULT_TYPE
        );
        new ConnectionImpl(
            subProcessNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        AbstractRuleBase ruleBase = (AbstractRuleBase) RuleBaseFactory.newRuleBase();
        ruleBase.addProcess(process);
       
        process = new RuleFlowProcess();
        process.setId("org.drools.process.subprocess");
        process.setName("SubProcess");
       
        startNode = new StartNode();
        startNode.setName("Start");
        startNode.setId(1);
        process.addNode(startNode);
        endNode = new EndNode();
        endNode.setName("EndNode");
        endNode.setId(2);
        process.addNode(endNode);
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Action");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
            public void execute(KnowledgeHelper knowledgeHelper, WorkingMemory workingMemory, ProcessContext context) throws Exception {
              System.out.println("Executed action");
              executed = true;
            }
        });
        actionNode.setAction(action);
        process.addNode(actionNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            actionNode, Node.CONNECTION_DEFAULT_TYPE
        );
        new ConnectionImpl(
        actionNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        ruleBase.addProcess(process);
View Full Code Here


        SubProcessNode subProcessNode = new SubProcessNode();
        subProcessNode.setName("SubProcessNode");
        subProcessNode.setId(3);
        subProcessNode.setProcessId("org.drools.process.subprocess");
        process.addNode(subProcessNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            subProcessNode, Node.CONNECTION_DEFAULT_TYPE
        );
        new ConnectionImpl(
            subProcessNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        AbstractRuleBase ruleBase = (AbstractRuleBase) RuleBaseFactory.newRuleBase();
        ruleBase.addProcess(process);
       
        process = new RuleFlowProcess();
        process.setId("org.drools.process.subprocess");
        process.setName("SubProcess");
       
        startNode = new StartNode();
        startNode.setName("Start");
        startNode.setId(1);
        process.addNode(startNode);
        endNode = new EndNode();
        endNode.setName("EndNode");
        endNode.setId(2);
        process.addNode(endNode);
        WorkItemNode workItemNode = new WorkItemNode();
        workItemNode.setName("WorkItem");
        Work work = new WorkImpl();
        work.setName("MyWork");
        workItemNode.setWork(work);
        process.addNode(workItemNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            workItemNode, Node.CONNECTION_DEFAULT_TYPE
        );
        new ConnectionImpl(
        workItemNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        ruleBase.addProcess(process);
View Full Code Here

      }
        });
        actionNode.setAction(action);
        actionNode.setId(2);
        process.addNode(actionNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            actionNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        EndNode endNode = new EndNode();
        endNode.setName("End");
        endNode.setId(3);
        process.addNode(endNode);
        new ConnectionImpl(
            actionNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        pkg.addProcess(process);
View Full Code Here

    }

    public RuleFlowNodeContainerFactory connection(long fromId, long toId) {
        Node from = nodeContainer.getNode(fromId);
        Node to = nodeContainer.getNode(toId);
        new ConnectionImpl(
            from, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
            to, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
        return this;
    }
View Full Code Here

        join.setMetaData("hidden", true);
        super.addNode(join);
        super.linkOutgoingConnections(
            new CompositeNode.NodeAndType(join, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE),
            org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
        new ConnectionImpl(
            super.getNode(1), org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
            getCompositeNode(), org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE
        );
        new ConnectionImpl(
            getCompositeNode(), org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
            super.getNode(3), org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE
        );
    }
View Full Code Here

          List<Connection> connections = getIncomingConnections(inType);
          for (Connection connection: connections) {
            CompositeNodeStart start = new CompositeNodeStart(connection.getFrom(), inType);
            internalAddNode(start);
            if (inNode.getNode() != null) {
              new ConnectionImpl(
                  start, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
                  inNode.getNode(), inNode.getType());
            }
          }
        }
View Full Code Here

          List<Connection> connections = getOutgoingConnections(outType);
          for (Connection connection: connections) {
            CompositeNodeEnd end = new CompositeNodeEnd(connection.getTo(), outType);
            internalAddNode(end);
            if (outNode.getNode() != null) {
              new ConnectionImpl(
                  outNode.getNode(), outNode.getType(),
                  end, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
            }
          }
        }
View Full Code Here

          if (inNode != null) {
            CompositeNodeStart start = new CompositeNodeStart(connection.getFrom(), type);
            internalAddNode(start);
            NodeImpl node = (NodeImpl) inNode.getNode();
            if (node != null) {
              new ConnectionImpl(
                  start, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
                  inNode.getNode(), inNode.getType());
            }
          }
      }
View Full Code Here

          if (outNode != null) {
            CompositeNodeEnd end = new CompositeNodeEnd(connection.getTo(), type);
            internalAddNode(end);
            NodeImpl node = (NodeImpl) outNode.getNode();
            if (node != null) {
              new ConnectionImpl(
                outNode.getNode(), outNode.getType(),
                end, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
            }
          }
      }
View Full Code Here

          List<Connection> connections = getIncomingConnections(inType);
          for (Connection connection: connections) {
            CompositeNodeStart start = new CompositeNodeStart(connection.getFrom(), inType);
            internalAddNode(start);
            if (inNode.getNode() != null) {
              new ConnectionImpl(
                  start, org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE,
                  inNode.getNode(), inNode.getType());
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.drools.workflow.core.impl.ConnectionImpl

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.