001: package org.obe.client.api.base;
002:
003: import org.obe.client.api.model.TemporalStatus;
004:
005: import java.io.Serializable;
006: import java.util.Date;
007:
008: /**
009: * @author Adrian Price
010: */
011: public abstract class AbstractTask implements Serializable {
012: private static final long serialVersionUID = 4138703038866374530L;
013: private String _id;
014: private String _name;
015: private String _activityDefinitionId;
016: private String _processDefinitionId;
017: private String _processInstanceId;
018: private int _priority;
019: private Date _startedDate;
020: private Date _targetDate;
021: private Date _dueDate;
022: private Date _completedDate;
023:
024: protected AbstractTask() {
025: }
026:
027: protected AbstractTask(String id, String name,
028: String activityDefinitionId, String processDefinitionId,
029: String processInstanceId, int priority, Date startedDate,
030: Date targetDate, Date dueDate, Date completedDate) {
031:
032: _id = id;
033: _name = name;
034: _activityDefinitionId = activityDefinitionId;
035: _processDefinitionId = processDefinitionId;
036: _processInstanceId = processInstanceId;
037: _priority = priority;
038: _startedDate = startedDate;
039: _targetDate = targetDate;
040: _dueDate = dueDate;
041: _completedDate = completedDate;
042: }
043:
044: public String getId() {
045: return _id;
046: }
047:
048: public final String getName() {
049: return _name;
050: }
051:
052: public final String getActivityDefinitionId() {
053: return _activityDefinitionId;
054: }
055:
056: public final int getPriority() {
057: return _priority;
058: }
059:
060: public final Date getCompletedDate() {
061: return _completedDate;
062: }
063:
064: public final Date getTargetDate() {
065: return _targetDate;
066: }
067:
068: public final Date getDueDate() {
069: return _dueDate;
070: }
071:
072: public final String getProcessDefinitionId() {
073: return _processDefinitionId;
074: }
075:
076: public final String getProcessInstanceId() {
077: return _processInstanceId;
078: }
079:
080: public final Date getStartedDate() {
081: return _startedDate;
082: }
083:
084: public final void setId(String id) {
085: _id = id;
086: }
087:
088: public final void setProcessDefinitionId(String processDefinitionId) {
089: _processDefinitionId = processDefinitionId;
090: }
091:
092: public final void setPriority(int priority) {
093: _priority = priority;
094: }
095:
096: public final void setStartedDate(Date startedDate) {
097: _startedDate = startedDate;
098: }
099:
100: public final void setTargetDate(Date targetDate) {
101: _targetDate = targetDate;
102: }
103:
104: public final void setDueDate(Date dueDate) {
105: _dueDate = dueDate;
106: }
107:
108: public final void setCompletedDate(Date completedDate) {
109: _completedDate = completedDate;
110: }
111:
112: public final void setName(String name) {
113: _name = name;
114: }
115:
116: public final void setActivityDefinitionId(
117: String activityDefinitionId) {
118: _activityDefinitionId = activityDefinitionId;
119: }
120:
121: public final void setProcessInstanceId(String processInstanceId) {
122: _processInstanceId = processInstanceId;
123: }
124:
125: public final void setPriority(Integer priority) {
126: if (priority != null)
127: _priority = priority.intValue();
128: }
129:
130: public abstract void setState(String state);
131:
132: public final TemporalStatus getTemporalStatus() {
133: return TemporalStatus.computeStatus(_completedDate,
134: _targetDate, _dueDate);
135: }
136: }
|