01: package org.enhydra.shark.xpdl.elements;
02:
03: import org.enhydra.shark.xpdl.XMLAttribute;
04: import org.enhydra.shark.xpdl.XMLComplexElement;
05: import org.enhydra.shark.xpdl.XPDLConstants;
06:
07: /**
08: * Represents coresponding element from XPDL schema.
09: *
10: * @author Sasa Bojanic
11: */
12: public class Deadline extends XMLComplexElement {
13:
14: public Deadline(Deadlines parent) {
15: super (parent, true);
16: }
17:
18: protected void fillStructure() {
19: DeadlineCondition refDeadlineCondition = new DeadlineCondition(
20: this ); // min=1, max=1
21: ExceptionName refExceptionName = new ExceptionName(this ); // min=1, max=1
22: XMLAttribute attrExecution = new XMLAttribute(this ,
23: "Execution", false, new String[] {
24: XPDLConstants.EXECUTION_NONE,
25: XPDLConstants.EXECUTION_ASYNCHR,
26: XPDLConstants.EXECUTION_SYNCHR }, 0);
27:
28: add(attrExecution);
29: add(refDeadlineCondition);
30: add(refExceptionName);
31: }
32:
33: public XMLAttribute getExecutionAttribute() {
34: return (XMLAttribute) get("Execution");
35: }
36:
37: public String getExecution() {
38: return getExecutionAttribute().toValue();
39: }
40:
41: public void setExecutionNONE() {
42: getExecutionAttribute().setValue(XPDLConstants.EXECUTION_NONE);
43: }
44:
45: public void setExecutionASYNCHR() {
46: getExecutionAttribute().setValue(
47: XPDLConstants.EXECUTION_ASYNCHR);
48: }
49:
50: public void setExecutionSYNCHR() {
51: getExecutionAttribute()
52: .setValue(XPDLConstants.EXECUTION_SYNCHR);
53: }
54:
55: public String getDeadlineCondition() {
56: return get("DeadlineCondition").toValue();
57: }
58:
59: public void setDeadlineCondition(String deadlineCondition) {
60: set("DeadlineCondition", deadlineCondition);
61: }
62:
63: public String getExceptionName() {
64: return get("ExceptionName").toValue();
65: }
66:
67: public void setExceptionName(String exceptionName) {
68: set("ExceptionName", exceptionName);
69: }
70: }
|