|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.domain.ObservableDomainObject
com.arsdigita.kernel.ACSObject
com.arsdigita.auditing.AuditedACSObject
com.arsdigita.workflow.simple.Task
This class represents the properties of a Task. Some programming guidelines to follow:
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
|
static int |
DELETED
|
static int |
DISABLED
|
static int |
ENABLED
|
static int |
FINISHED
|
static int |
INACTIVE
|
static String |
versionId
|
Fields inherited from class com.arsdigita.kernel.ACSObject |
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE |
Constructor Summary | |
|
Task()
Creates a new task. |
|
Task(BigDecimal id)
Creates a new task for a given ID. |
|
Task(DataObject taskDataObject)
Restores a task from a data object. |
protected |
Task(ObjectType type)
Creates a new task given the object type. |
|
Task(OID oid)
Creates a new task for a given OID. |
protected |
Task(String typeName)
Creates a new task given the object type name. |
|
Task(String label,
String description)
Creates a new task. |
Method Summary | |
void |
addComment(String comment)
Adds a comment specifying the description string (persistent after save). |
void |
addComment(TaskComment c)
Adds a comment (persistent after save). |
void |
addComment(User user,
String comment)
Adds a comment specifying the user (persistent after save). |
boolean |
addDependency(Task task)
Adds a dependency to this task. |
void |
addFinishedListener(Task task)
Adds a task as a listener to this task. |
Object |
clone()
Clones a task. |
protected void |
copyAttributes(Task task)
Exports the attributes of this domain object. |
void |
delete()
Deletes this object. |
void |
disable()
Disables a task. |
protected void |
disableEvt()
Called when a task is disabled. |
void |
enable()
Enables a task and calls enableEvt, which is overwritten by subclasses to extend functionality. |
protected void |
enableEvt()
Called when the task is enabled. |
boolean |
equals(Object object)
An object is equal to this if the object is of type task and the IDs are the same. |
void |
finish()
Marks the task as finished. |
protected void |
finishEvt()
Called when a task is finished. |
protected String |
getBaseDataObjectType()
Retrieves the type of the base data object. |
Iterator |
getComments()
Returns an iterator over a set of task comments. |
int |
getCommentsSize()
Gets the number of comments. |
Iterator |
getDependencies()
Retrieves the task dependencies. |
int |
getDependencyCount()
Retrieves the number of dependencies. |
String |
getDescription()
Gets the task description. |
String |
getDisplayName()
Returns a display name for this object. |
Iterator |
getFinishedListeners()
Returns the list of finished listeners. |
int |
getFinishedListenersCount()
Returns the number of finished listeners |
protected Collection |
getFinishedListenersInternal()
Retrieves the finished listeners. |
String |
getLabel()
Gets the label for this task. |
protected TaskComment |
getLastComment()
Get the last comment that was added to this Task |
protected TaskComment |
getLastCommentInWorkflow()
Get the last comment that was added to any task in this Workflow |
BigDecimal |
getParentID()
The ID of the process that this task is in. |
TaskCollection |
getRequiredTasks()
|
int |
getState()
Get the state of a task. |
static int |
getStateMapping(String taskState)
Helper method to convert from persistent representation to object representation |
String |
getStateString()
Gets the state in a string for the task. |
static String |
getStateString(int state)
Helper method to convert from object presentation to persistent presentation |
Workflow |
getWorkflow()
Get the Workflow that this Task is in |
protected void |
initAttributes(String label,
String description)
Sets the label and dDescription for this task. |
protected void |
initialize()
Initializes a task. |
boolean |
isActive()
Checks whether the task part of the active process. |
boolean |
isDependency(Task task)
Checks whether this task depends directly on another task. |
boolean |
isEnabled()
Tests whether the task is enabled. |
boolean |
isFinished()
Tests whether the task is finished. |
void |
notifyFinished(Task senderTask)
Notifies finished listeners. |
void |
removeAllDependencies()
Removes all dependencies from this task. |
void |
removeAllFinishedListeners()
Removes all dependencies from this task. |
void |
removeComment(TaskComment taskComment)
Removes comment (persistent after save). |
void |
removeDependency(Task task)
Removes a dependency from this task. |
void |
removeFinishedListener(Task task)
Removes a task from the list of listeners. |
protected void |
rollbackEvt()
When the task is moved from enabled to disabled state. |
void |
setActive(boolean isActive)
Marks this task as active, which indicates that it is fully configured and ready to become part of an active process. |
void |
setDescription(String description)
Sets the task description. |
void |
setLabel(String label)
Sets the label for this task. |
void |
setState(int state)
DO NOT USE Should be private. |
String |
toString()
Returns a string describing the task. |
Methods inherited from class com.arsdigita.auditing.AuditedACSObject |
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser |
Methods inherited from class com.arsdigita.kernel.ACSObject |
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID |
Methods inherited from class com.arsdigita.domain.ObservableDomainObject |
addObserver, getObservers |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
public static final String BASE_DATA_OBJECT_TYPE
public static final int DISABLED
public static final int ENABLED
public static final int FINISHED
public static final int DELETED
public static final int INACTIVE
Constructor Detail |
public Task(String label, String description)
save()
method is called.
label
- the task labeldescription
- the task descriptionpublic Task(DataObject taskDataObject)
taskDataObject
- the data objectpublic Task()
save()
method is called.
The properties label
and description
are
set to null. If save() is called without setting these
properties, an IllegalArgumentException will be thrown.
public Task(OID oid) throws DataObjectNotFoundException
oid
- the Object IDpublic Task(BigDecimal id) throws DataObjectNotFoundException
protected Task(ObjectType type)
type
- the object typeprotected Task(String typeName)
typeName
- the name of the typeMethod Detail |
protected void initialize()
initialize
in class AuditedACSObject
protected void initAttributes(String label, String description)
label
- the task labeldescription
- the task descriptionprotected String getBaseDataObjectType()
getBaseDataObjectType
in class ACSObject
public void setLabel(String label)
label
- the new label for this taskpublic String getLabel()
public String getStateString()
public void setDescription(String description)
description
- the task descriptionpublic String getDescription()
public void setActive(boolean isActive)
updateState
method for finished listeners
to let them know that is either part of the model or not.
(persistent operation)
isActive
- true
to active this task as part
of an active task.public boolean isActive()
true
if the task part of the active
process; false
otherwise.public BigDecimal getParentID()
public Workflow getWorkflow()
public Iterator getDependencies()
public final TaskCollection getRequiredTasks()
public boolean addDependency(Task task)
task
- Another task that this task depends on
true
if the task was added successfully;
false
otherwise.public void removeDependency(Task task)
save
method is made.
task
- public boolean isDependency(Task task)
task
- the task to check
true
if this task depends on
a passed in task; false
otherwise.public void removeAllDependencies()
public void removeAllFinishedListeners()
public int getDependencyCount()
public boolean equals(Object object)
task
and the IDs are the same.
equals
in class DomainObject
object
- the object
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
protected void copyAttributes(Task task)
task
- the domain object to which this method copies the
attributes of this objectpublic String toString()
toString
in class DomainObject
public void addComment(TaskComment c)
c
- the comment to addpublic void addComment(User user, String comment)
user
- the usercomment
- the commentpublic void addComment(String comment)
comment
- the commentpublic void removeComment(TaskComment taskComment)
taskComment
- the commentpublic Iterator getComments()
public int getCommentsSize()
protected TaskComment getLastComment()
protected TaskComment getLastCommentInWorkflow()
public Iterator getFinishedListeners()
protected Collection getFinishedListenersInternal()
public void addFinishedListener(Task task)
task
- a listener task in the processpublic void removeFinishedListener(Task task)
task
- the task to removepublic int getFinishedListenersCount()
public void enable()
public void disable()
public int getState()
public void setState(int state)
state
- the state to set the taskpublic static String getStateString(int state)
public static int getStateMapping(String taskState)
taskState
- the state string
public void finish() throws TaskException
TaskException
public boolean isEnabled()
true
if the task is enabled;
false
otherwise.public boolean isFinished()
true
if the task is finished; otherwise.public void notifyFinished(Task senderTask) throws TaskException, ProcessException
senderTask
- the task that is completed
TaskException
ProcessException
public void delete()
DomainObject
delete
in class DomainObject
DataObject.delete()
public String getDisplayName()
ACSObject
getDisplayName
in class ACSObject
protected void rollbackEvt()
protected void enableEvt()
protected void disableEvt()
protected void finishEvt()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |