1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.engine.transition;
17
18 import org.kuali.rice.kew.engine.RouteContext;
19 import org.kuali.rice.kew.engine.node.JoinNode;
20 import org.kuali.rice.kew.engine.node.ProcessResult;
21 import org.kuali.rice.kew.engine.node.RouteNodeInstance;
22
23
24
25
26
27
28
29
30 public class JoinTransitionEngine extends TransitionEngine {
31
32 public RouteNodeInstance transitionTo(RouteNodeInstance nextNodeInstance, RouteContext context) {
33 if (context.getNodeInstance().getBranch().getJoinNode() != null) {
34 nextNodeInstance = context.getNodeInstance().getBranch().getJoinNode();
35 } else{
36 nextNodeInstance = getRouteHelper().getJoinEngine().createExpectedJoinState(context, nextNodeInstance, context.getNodeInstance());
37 }
38 getRouteHelper().getJoinEngine().addActualJoiner(nextNodeInstance, context.getNodeInstance().getBranch());
39 return nextNodeInstance;
40 }
41
42 public ProcessResult isComplete(RouteContext context) throws Exception {
43 RouteNodeInstance nodeInstance = context.getNodeInstance();
44 JoinNode node = (JoinNode)getNode(nodeInstance.getRouteNode(), JoinNode.class);
45 return node.process(context, getRouteHelper());
46 }
47
48 }