1 package org.jbpm.bpel.exe.state; 2 3 import org.jbpm.graph.exe.ExecutionContext; 4 5 import org.jbpm.bpel.def.ScopeHandler; 6 import org.jbpm.bpel.exe.ScopeInstance; 7 8 12 public abstract class HandlingState extends ScopeState { 13 14 protected HandlingState(String name, int code) { 16 super(name, code); 17 } 18 19 public void childrenCompensated(ScopeInstance scope) { 20 throw newStateException("compensated"); 21 } 22 23 protected void handleImplicitly(ScopeInstance scope) { 24 ScopeInstance.get(scope.getToken()).compensateNextChild(); 26 } 27 28 protected void handleExplicitly(ScopeInstance scope, ScopeHandler handler) { 29 handler.execute(new ExecutionContext(scope.getToken())); 31 } 32 33 protected void enterFaulted(ScopeInstance scope) { 34 scope.setState(EndedState.FAULTED); 35 ScopeInstance parent = scope.getParent(); 36 37 if(parent != null) { 38 scope.getParent().faulted(scope.getFault()); 39 } 40 } 41 } 42 | Popular Tags |