StartNode startNode = new StartNode();
startNode.setName("Start");
startNode.setId(1);
process.addNode(startNode);
EndNode endNode = new EndNode();
endNode.setName("EndNode");
endNode.setId(2);
process.addNode(endNode);
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");