Information Technology Reference
In-Depth Information
ActionNode scriptTask = new ActionNode();
scriptTask.setId(2);
DroolsAction action = new DroolsAction();
action.setMetaData("Action", new Action() {
@Override
public void execute(ProcessContext context) throws
Exception {
System.out.println("Executing the Action!!");
}
});
scriptTask.setAction(action);
//End Task
EndNode endTask = new EndNode();
endTask.setId(3);
//Adding the connections to the nodes and the nodes to the
processes
new ConnectionImpl(startTask, "DROOLS_DEFAULT",
scriptTask, "DROOLS_DEFAULT");
new ConnectionImpl(scriptTask, "DROOLS_DEFAULT",
endTask, "DROOLS_DEFAULT");
process.addNode(startTask);
process.addNode(scriptTask);
process.addNode(endTask);
Using this code, we can manually create the object structures to represent the process
shown in the following figure:
Search WWH ::




Custom Search