01: /*
02: * Created on Jul 14, 2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.bpm.flow;
08:
09: import java.util.HashMap;
10:
11: import org.xdev.base.xssl.XSSLAction;
12: import org.xdev.base.xssl.XSSLReturn;
13:
14: /**
15: * @author AYegorov
16: *
17: * To change the template for this generated type comment go to
18: * Window>Preferences>Java>Code Generation>Code and Comments
19: */
20: public class TryCatchFlow extends XSSLReturn {
21: private Object returnValue = null;
22:
23: /**
24: * @param id
25: */
26: public TryCatchFlow(String id) {
27: super (id);
28: // TODO Auto-generated constructor stub
29: }
30:
31: /**
32: * @param id
33: * @param properties
34: */
35: public TryCatchFlow(String id, HashMap properties) {
36: super (id, properties);
37: // TODO Auto-generated constructor stub
38: }
39:
40: protected void set() throws Exception {
41: XSSLAction action = (XSSLAction) this .getElement(0);
42:
43: Exception exception = null;
44:
45: try {
46: action.execute(this );
47:
48: if (action instanceof XSSLReturn) {
49: this .returnValue = ((XSSLReturn) action)
50: .getObjectValue();
51: }
52: } catch (Exception ex) {
53: exception = ex;
54: } finally {
55: if (this .getCount() > 1) {
56: XSSLAction finl = (XSSLAction) this .getElement(1);
57:
58: this .logDebug("Executing finally implementation: "
59: + finl);
60:
61: finl.execute(this );
62: }
63:
64: if (this .throwsException() && this .exception != null) {
65: throw this .exception;
66: }
67: }
68: }
69:
70: public Object getObjectValue() {
71: return this.returnValue;
72: }
73: }
|