timerNode.setName( "Timer" );
Timer timer = new Timer();
timer.setDelay( "2000" );
timerNode.setTimer( timer );
process.addNode( timerNode );
new ConnectionImpl( start,
Node.CONNECTION_DEFAULT_TYPE,
timerNode,
Node.CONNECTION_DEFAULT_TYPE );
ActionNode actionNode = new ActionNode();
actionNode.setId( 3 );
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( timerNode,
Node.CONNECTION_DEFAULT_TYPE,
actionNode,
Node.CONNECTION_DEFAULT_TYPE );
EndNode end = new EndNode();
end.setId( 6 );
end.setName( "End" );
process.addNode( end );
new ConnectionImpl( actionNode,
Node.CONNECTION_DEFAULT_TYPE,
end,
Node.CONNECTION_DEFAULT_TYPE );
PackageBuilder packageBuilder = new PackageBuilder();