Skip to content

Commit

Permalink
amended the small change in the XORSplitBehaviour, though we discover…
Browse files Browse the repository at this point in the history
…ed the problem to be at a different point in the reference process, is fixed now
  • Loading branch information
tmetzke committed May 18, 2011
1 parent f408811 commit e0f6348
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ test-output
target
bin
reports
logs
logs
/engine-demo/.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import java.util.Map;
import java.util.UUID;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.jodaengine.allocation.Form;
import org.jodaengine.deployment.DeploymentBuilder;
import org.jodaengine.exception.DefinitionNotFoundException;
Expand All @@ -24,6 +21,8 @@
import org.jodaengine.resource.allocation.CreationPatternBuilderImpl;
import org.jodaengine.resource.allocation.FormImpl;
import org.jodaengine.resource.allocation.pattern.OfferMultiplePattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The Class ShortenedReferenceProcessDeployer. This is the implementation of the shortened version of the AOK reference
Expand Down Expand Up @@ -326,6 +325,7 @@ public void initializeNodes() {
Condition condition5 = new JuelExpressionCondition("${aufrecht == \"ja\"}");
map2 = new HashMap<String, Object>();
map2.put("aufrecht", "nein");
Condition condition6 = new JuelExpressionCondition("${aufrecht == \"nein\"}");

// XOR Join
xor4 = BpmnNodeFactory.createBpmnXorGatewayNode(processDefinitionBuilder);
Expand Down Expand Up @@ -367,6 +367,7 @@ public void initializeNodes() {
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, xor2, xor4, condition4);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, human3, xor3);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, xor3, xor4, condition5);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, xor3, xor5, condition6);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, xor4, human4);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, human4, human5);
BpmnNodeFactory.createTransitionFromTo(processDefinitionBuilder, xor5, system2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class XORSplitBehaviour implements OutgoingBehaviour {
public List<Token> split(List<Token> instances)
throws NoValidPathException {

// TODO why do the instances get returned here, could somebody please leave a short comment on that? Didn't get
// it right away, so probably somebody else won't too
if (instances.size() == 0) {
return instances;
}
Expand All @@ -37,19 +35,12 @@ public List<Token> split(List<Token> instances)

// we look through the outgoing transitions and try to find one at least, whose condition evaluates true and
// then return it as the to-be-taken transition
// if there only is one outgoing one, take this one
for (Token instance : instances) {
Node currentNode = instance.getCurrentNode();
List<Transition> outgoingTransitions = currentNode.getOutgoingTransitions();

if (outgoingTransitions.size() == 1) {
transitionList.add(outgoingTransitions.get(0));
} else {
for (Transition transition : currentNode.getOutgoingTransitions()) {
if (transition.getCondition().evaluate(instance)) {
transitionList.add(transition);
break;
}
for (Transition transition : currentNode.getOutgoingTransitions()) {
if (transition.getCondition().evaluate(instance)) {
transitionList.add(transition);
break;
}
}

Expand Down

0 comments on commit e0f6348

Please sign in to comment.