01: /*
02: * Created on Oct 16, 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.ArrayList;
10: import java.util.HashMap;
11:
12: import org.xdev.base.xssl.XSSLAction;
13: import org.xdev.base.xssl.XSSLReturn;
14:
15: /**
16: * @author AYegorov
17: *
18: * To change the template for this generated type comment go to
19: * Window>Preferences>Java>Code Generation>Code and Comments
20: */
21: public class DoWhileFlow extends XSSLReturn {
22: private Object returnValue = null;
23:
24: /**
25: * @param id
26: */
27: public DoWhileFlow(String id) {
28: super (id);
29: // TODO Auto-generated constructor stub
30: }
31:
32: /**
33: * @param id
34: * @param properties
35: */
36: public DoWhileFlow(String id, HashMap properties) {
37: super (id, properties);
38: // TODO Auto-generated constructor stub
39: }
40:
41: /* (non-Javadoc)
42: * @see org.xdev.base.transaction.TemplateAbstractElement#getValue()
43: */
44: public Object getObjectValue() {
45: return this .returnValue;
46: }
47:
48: protected synchronized void set() throws Exception {
49: XSSLAction condition = (XSSLAction) this .getElement(0);
50: XSSLAction action = (XSSLAction) this .getElement(1);
51: do {
52: if (action.execute(this )) {
53: if (action instanceof XSSLReturn) {
54: this .returnValue = ((XSSLReturn) action)
55: .getObjectValue();
56: this
57: .logDebug("Intermediate result of do-while condition: "
58: + this .returnValue);
59: }
60: }
61: this .logDebug("Execution status of do-while condition: "
62: + condition.getExecutionStatus());
63: if (this .getBooleanProperty("reset-condition")) {
64: condition.reset();
65: }
66: } while ((condition.execute(this)));
67: }
68:
69: }
|