KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > def > FaultHandler


1 package org.jbpm.bpel.def;
2
3 import javax.xml.namespace.QName JavaDoc;
4
5 import org.jbpm.graph.exe.ExecutionContext;
6
7 import org.jbpm.bpel.data.def.VariableDefinition;
8
9 /**
10  * @author Juan Cantú
11  * @version $Revision: 1.4 $ $Date: 2005/06/10 17:32:58 $
12  */

13 public class FaultHandler extends ScopeHandler {
14   
15   public FaultHandler() {
16     super();
17   }
18
19   private static final long serialVersionUID = 1L;
20   
21   private QName JavaDoc faultName;
22   private VariableDefinition faultVariable;
23
24   public void execute(ExecutionContext context) {
25     //TODO add a nested token with the fault variable in its execution context
26
super.execute(context);
27   }
28   
29   // CompositeActivity override //////////////////////////////////////////////////////////
30

31   /**{@inheritDoc}*/
32   public VariableDefinition findVariable(String JavaDoc varName) {
33     return faultVariable != null &&
34     faultVariable.getName().equals(varName) ? faultVariable
35                                               : super.findVariable(varName);
36   }
37   
38   // fault handler properties ////////////////////////////////////////////////////////////
39

40   public QName JavaDoc getFaultName() {
41     return faultName;
42   }
43
44   public void setFaultName(QName JavaDoc faultName) {
45     this.faultName = faultName;
46   }
47   
48   public VariableDefinition getFaultVariable() {
49     return faultVariable;
50   }
51   
52   public void setFaultVariable(VariableDefinition faultVariable) {
53     this.faultVariable = faultVariable;
54   }
55 }
Popular Tags