001: package org.enhydra.shark.xpdl.elements;
002:
003: import org.enhydra.shark.xpdl.XMLAttribute;
004: import org.enhydra.shark.xpdl.XMLComplexElement;
005: import org.enhydra.shark.xpdl.XPDLConstants;
006:
007: /**
008: * Represents coresponding element from XPDL schema.
009: *
010: * @author Sasa Bojanic
011: */
012: public class ProcessHeader extends XMLComplexElement {
013:
014: public ProcessHeader(WorkflowProcess parent) {
015: super (parent, true);
016: }
017:
018: protected void fillStructure() {
019: XMLAttribute attrDurationUnit = new XMLAttribute(this ,
020: "DurationUnit", false, new String[] {
021: XPDLConstants.DURATION_UNIT_NONE,
022: XPDLConstants.DURATION_UNIT_Y,
023: XPDLConstants.DURATION_UNIT_M,
024: XPDLConstants.DURATION_UNIT_D,
025: XPDLConstants.DURATION_UNIT_h,
026: XPDLConstants.DURATION_UNIT_m,
027: XPDLConstants.DURATION_UNIT_s }, 0);
028: Created refCreated = new Created(this ); // min=0
029: Description refDescription = new Description(this ); // min=0
030: Priority refPriority = new Priority(this ); // min=0
031: Limit refLimit = new Limit(this ); // min=0
032: ValidFrom refValidFrom = new ValidFrom(this ); // min=0
033: ValidTo refValidTo = new ValidTo(this ); // min=0
034: TimeEstimation refTimeEstimation = new TimeEstimation(this ); // min=0
035:
036: add(attrDurationUnit);
037: add(refCreated);
038: add(refDescription);
039: add(refPriority);
040: add(refLimit);
041: add(refValidFrom);
042: add(refValidTo);
043: add(refTimeEstimation);
044: }
045:
046: public XMLAttribute getDurationUnitAttribute() {
047: return (XMLAttribute) get("DurationUnit");
048: }
049:
050: public String getDurationUnit() {
051: return getDurationUnitAttribute().toValue();
052: }
053:
054: public void setDurationUnitNONE() {
055: getDurationUnitAttribute().setValue(
056: XPDLConstants.DURATION_UNIT_NONE);
057: }
058:
059: public void setDurationUnitYEAR() {
060: getDurationUnitAttribute().setValue(
061: XPDLConstants.DURATION_UNIT_Y);
062: }
063:
064: public void setDurationUnitMONTH() {
065: getDurationUnitAttribute().setValue(
066: XPDLConstants.DURATION_UNIT_M);
067: }
068:
069: public void setDurationUnitDAY() {
070: getDurationUnitAttribute().setValue(
071: XPDLConstants.DURATION_UNIT_D);
072: }
073:
074: public void setDurationUnitHOUR() {
075: getDurationUnitAttribute().setValue(
076: XPDLConstants.DURATION_UNIT_h);
077: }
078:
079: public void setDurationUnitMINUTE() {
080: getDurationUnitAttribute().setValue(
081: XPDLConstants.DURATION_UNIT_m);
082: }
083:
084: public void setDurationUnitSECOND() {
085: getDurationUnitAttribute().setValue(
086: XPDLConstants.DURATION_UNIT_s);
087: }
088:
089: public String getCreated() {
090: return get("Created").toValue();
091: }
092:
093: public void setCreated(String created) {
094: set("Created", created);
095: }
096:
097: public String getDescription() {
098: return get("Description").toValue();
099: }
100:
101: public void setDescription(String description) {
102: set("Description", description);
103: }
104:
105: public String getPriority() {
106: return get("Priority").toValue();
107: }
108:
109: public void setPriority(String priority) {
110: set("Priority", priority);
111: }
112:
113: public String getLimit() {
114: return get("Limit").toValue();
115: }
116:
117: public void setLimit(String limit) {
118: set("Limit", limit);
119: }
120:
121: public String getValidFrom() {
122: return get("ValidFrom").toValue();
123: }
124:
125: public void setValidFrom(String validFrom) {
126: set("ValidFrom", validFrom);
127: }
128:
129: public String getValidTo() {
130: return get("ValidTo").toValue();
131: }
132:
133: public void setValidTo(String validTo) {
134: set("ValidTo", validTo);
135: }
136:
137: public TimeEstimation getTimeEstimation() {
138: return (TimeEstimation) get("TimeEstimation");
139: }
140:
141: }
|