ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
ruleSet2.setId(4);
final RuleSetNode ruleSet3 = new RuleSetNode();
ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
ruleSet3.setId(5);
final Split split = new Split();
split.setType( Split.TYPE_XOR );
split.setId(6);
final Join join = new Join();
join.setType( Join.TYPE_XOR );
join.setId(7);
final EndNode end = new EndNode();
end.setId(8);
// connections
new ConnectionImpl( start,
Node.CONNECTION_DEFAULT_TYPE,
ruleSet0,
Node.CONNECTION_DEFAULT_TYPE );
new ConnectionImpl( ruleSet0,
Node.CONNECTION_DEFAULT_TYPE,
split,
Node.CONNECTION_DEFAULT_TYPE );
Connection out1 = new ConnectionImpl( split,
Node.CONNECTION_DEFAULT_TYPE,
ruleSet1,
Node.CONNECTION_DEFAULT_TYPE );
Connection out2 = new ConnectionImpl( split,
Node.CONNECTION_DEFAULT_TYPE,
ruleSet2,
Node.CONNECTION_DEFAULT_TYPE );
new ConnectionImpl( ruleSet1,
Node.CONNECTION_DEFAULT_TYPE,
join,
Node.CONNECTION_DEFAULT_TYPE );
new ConnectionImpl( ruleSet2,
Node.CONNECTION_DEFAULT_TYPE,
join,
Node.CONNECTION_DEFAULT_TYPE );
new ConnectionImpl( join,
Node.CONNECTION_DEFAULT_TYPE,
ruleSet3,
Node.CONNECTION_DEFAULT_TYPE );
new ConnectionImpl( ruleSet3,
Node.CONNECTION_DEFAULT_TYPE,
end,
Node.CONNECTION_DEFAULT_TYPE );
ConstraintEvaluator constraint1 = new org.drools.workflow.instance.impl.RuleConstraintEvaluator();
constraint1.setPriority( 1 );
split.setConstraint( out1,
constraint1 );
ConstraintEvaluator constraint2 = new org.drools.workflow.instance.impl.RuleConstraintEvaluator();
constraint2.setPriority( 2 );
split.setConstraint( out2,
constraint2 );
// process
final RuleFlowProcess process = new RuleFlowProcess();
process.setId( "1" );
process.addNode( start );
process.addNode( ruleSet0 );
process.addNode( ruleSet1 );
process.addNode( ruleSet2 );
process.addNode( ruleSet3 );
process.addNode( split );
process.addNode( join );
process.addNode( end );
// rules for split
final Rule splitRule1 = new Rule( "RuleFlow-Split-1-" + split.getId() + "-" + ruleSet1.getId() );
splitRule1.setRuleFlowGroup( "DROOLS_SYSTEM" );
splitRule1.setConsequence( consequence );
final RuleTerminalNode splitNode1 = new RuleTerminalNode( 7,
new MockTupleSource( 2 ),
splitRule1,
splitRule1.getLhs(),
buildContext );
final Rule splitRule2 = new Rule( "RuleFlow-Split-1-" + split.getId() + "-" + ruleSet2.getId() );
splitRule2.setRuleFlowGroup( "DROOLS_SYSTEM" );
splitRule2.setConsequence( consequence );
final RuleTerminalNode splitNode2 = new RuleTerminalNode( 8,
new MockTupleSource( 2 ),