KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > xpdl > elements > ProcessHeader


1 package org.enhydra.shark.xpdl.elements;
2
3 import org.enhydra.shark.xpdl.XMLAttribute;
4 import org.enhydra.shark.xpdl.XMLComplexElement;
5 import org.enhydra.shark.xpdl.XPDLConstants;
6
7 /**
8  * Represents coresponding element from XPDL schema.
9  *
10  * @author Sasa Bojanic
11  */

12 public class ProcessHeader extends XMLComplexElement {
13
14    public ProcessHeader (WorkflowProcess parent) {
15       super(parent, true);
16    }
17
18    protected void fillStructure () {
19       XMLAttribute attrDurationUnit=new XMLAttribute(this,"DurationUnit",
20             false,new String JavaDoc[] {
21                "",
22                XPDLConstants.DURATION_UNIT_Y,
23                XPDLConstants.DURATION_UNIT_M,
24                XPDLConstants.DURATION_UNIT_D,
25                XPDLConstants.DURATION_UNIT_h,
26                XPDLConstants.DURATION_UNIT_m,
27                XPDLConstants.DURATION_UNIT_s
28             }, 0);
29       Created refCreated=new Created(this); // min=0
30
Description refDescription=new Description(this); // min=0
31
Priority refPriority=new Priority(this); // min=0
32
Limit refLimit=new Limit(this); // min=0
33
ValidFrom refValidFrom=new ValidFrom(this); // min=0
34
ValidTo refValidTo=new ValidTo(this); // min=0
35
TimeEstimation refTimeEstimation=new TimeEstimation(this); // min=0
36

37       add(attrDurationUnit);
38       add(refCreated);
39       add(refDescription);
40       add(refPriority);
41       add(refLimit);
42       add(refValidFrom);
43       add(refValidTo);
44       add(refTimeEstimation);
45    }
46
47    public XMLAttribute getDurationUnitAttribute() {
48       return (XMLAttribute)get("DurationUnit");
49    }
50    public String JavaDoc getDurationUnit() {
51       return getDurationUnitAttribute().toValue();
52    }
53    public void setDurationUnitNONE() {
54       getDurationUnitAttribute().setValue("");
55    }
56    public void setDurationUnitYEAR() {
57       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_Y);
58    }
59    public void setDurationUnitMONTH() {
60       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_M);
61    }
62    public void setDurationUnitDAY() {
63       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_D);
64    }
65    public void setDurationUnitHOUR() {
66       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_h);
67    }
68    public void setDurationUnitMINUTE() {
69       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_m);
70    }
71    public void setDurationUnitSECOND() {
72       getDurationUnitAttribute().setValue(XPDLConstants.DURATION_UNIT_s);
73    }
74    public String JavaDoc getCreated() {
75       return get("Created").toValue();
76    }
77    public void setCreated(String JavaDoc created) {
78       set("Created",created);
79    }
80    public String JavaDoc getDescription() {
81       return get("Description").toValue();
82    }
83    public void setDescription(String JavaDoc description) {
84       set("Description",description);
85    }
86    public String JavaDoc getPriority() {
87       return get("Priority").toValue();
88    }
89    public void setPriority(String JavaDoc priority) {
90       set("Priority",priority);
91    }
92    public String JavaDoc getLimit() {
93       return get("Limit").toValue();
94    }
95    public void setLimit(String JavaDoc limit) {
96       set("Limit",limit);
97    }
98    public String JavaDoc getValidFrom() {
99       return get("ValidFrom").toValue();
100    }
101    public void setValidFrom(String JavaDoc validFrom) {
102       set("ValidFrom",validFrom);
103    }
104    public String JavaDoc getValidTo() {
105       return get("ValidTo").toValue();
106    }
107    public void setValidTo(String JavaDoc validTo) {
108       set("ValidTo",validTo);
109    }
110    public TimeEstimation getTimeEstimation() {
111       return (TimeEstimation)get("TimeEstimation");
112    }
113    
114 }
115
Popular Tags