1 package org.jbpm.bpel.exe; 2 3 import org.jbpm.context.exe.ContextInstance; 4 import org.jbpm.graph.exe.Token; 5 import org.jbpm.bpel.exe.state.ActiveState; 6 7 11 public class EventInstance extends ScopeInstance { 12 13 private static final long serialVersionUID = 1L; 14 15 protected EventInstance() { 16 } 17 18 protected EventInstance(Token token) { 19 super(token); 20 } 21 22 public void notifyCompletion() { 23 ScopeInstance parent = getParent(); 25 26 if(parent.getState().equals(ActiveState.EVENTS_PENDING) 27 && !ActiveState.EVENTS_PENDING.hasPendingEvents(parent)) { 28 parent.completed(); 30 } 31 } 32 33 public static ScopeInstance create(Token token) { 34 ContextInstance contextInstance = token.getProcessInstance().getContextInstance(); 35 EventInstance instance = new EventInstance(token); 36 instance.setState(ActiveState.NORMAL_PROCESSING); 38 contextInstance.createVariable(SCOPE_NAME, instance, token); 39 return instance; 40 } 41 } | Popular Tags |