use of org.jbpm.simulation.PathContext.Type in project droolsjbpm-integration by kiegroup.
the class GatewayElementHandler method handleInclusiveGateway.
protected void handleInclusiveGateway(List<SequenceFlow> outgoing) {
// firstly cover simple xor based - number of paths is equal to number
// of outgoing
handleExclusiveGateway(outgoing);
Type currentType = manager.getContextFromStack().getType();
manager.getContextFromStack().setType(Type.ROOT);
// next cover all combinations of paths
if (outgoing.size() > 2) {
List<SequenceFlow> copy = new ArrayList<SequenceFlow>(outgoing);
List<SequenceFlow> andCombination = null;
for (SequenceFlow flow : outgoing) {
// first remove one that we currently processing as that is not
// a combination
copy.remove(flow);
PathContext contextAtThisNode = manager.cloneGivenWithoutPush(manager.getContextFromStack());
for (SequenceFlow copyFlow : copy) {
manager.cloneGiven(contextAtThisNode);
andCombination = new ArrayList<SequenceFlow>();
andCombination.add(flow);
andCombination.add(copyFlow);
handleParallelGateway(andCombination);
}
}
}
manager.getContextFromStack().setType(Type.ROOT);
// lastly cover and based - is single path that goes through all at the
// same time
handleParallelGateway(outgoing);
manager.getContextFromStack().setType(currentType);
}
Aggregations