KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > exe > state > HandlingState


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 /**
9  * @author Juan Cantú
10  * @version $Revision: 1.2 $ $Date: 2005/06/16 19:15:36 $
11  */

12 public abstract class HandlingState extends ScopeState {
13
14   //private static Log handlerLog = LogFactory.getLog(HandlingState.class);
15
protected HandlingState(String JavaDoc 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     //handlerLog.debug("handling implicitly");
25
ScopeInstance.get(scope.getToken()).compensateNextChild();
26   }
27
28   protected void handleExplicitly(ScopeInstance scope, ScopeHandler handler) {
29     //handlerLog.debug("handling explicitly");
30
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