ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
final RuleSetNode ruleSet2 = new RuleSetNodeImpl();
ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
final RuleSetNode ruleSet3 = new RuleSetNodeImpl();
ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
final Split split = new SplitImpl();
split.setType( Split.TYPE_XOR );
final Join join = new JoinImpl();
join.setType( Join.TYPE_XOR );
final EndNode end = new EndNodeImpl();
// connections
new ConnectionImpl( start,
ruleSet0,
Connection.TYPE_NORMAL );
new ConnectionImpl( ruleSet0,
split,
Connection.TYPE_NORMAL );
Connection out1 = new ConnectionImpl( split,
ruleSet1,
Connection.TYPE_NORMAL );
Connection out2 = new ConnectionImpl( split,
ruleSet2,
Connection.TYPE_NORMAL );
new ConnectionImpl( ruleSet1,
join,
Connection.TYPE_NORMAL );
new ConnectionImpl( ruleSet2,
join,
Connection.TYPE_NORMAL );
new ConnectionImpl( join,
ruleSet3,
Connection.TYPE_NORMAL );
new ConnectionImpl( ruleSet3,
end,
Connection.TYPE_NORMAL );
Constraint constraint1 = new org.drools.ruleflow.core.impl.ConstraintImpl();
constraint1.setPriority(1);
split.setConstraint(out1, constraint1);
Constraint constraint2 = new org.drools.ruleflow.core.impl.ConstraintImpl();
constraint2.setPriority(2);
split.setConstraint(out2, constraint2);
// process
final RuleFlowProcess process = new RuleFlowProcessImpl();
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 ),