com.waveset.object
Class WorkItem

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.WorkItem
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, XmlObject

public class WorkItem
extends PersistentObject

This class is used to represent the state of a work list item. These were formerly called "workflow tasks" but the name was changed to prevent confusion with TaskInstance.

A work item is created for each manual Action in the workfow process. Work items are "owned" by a particular Administrator, and the GUI is expected to provide a way to examine the assigned work items and edit them.

The work item will contain a set of variable values copied from the running case. By default it will contain a complete set of all workflow variables, this can be restricted by setting the "exposedVariables" and "editableVariables" lists in the associated action definition.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String APPROVAL
           
static java.lang.String ATT_IGNORE_TIMEOUT
           
static java.lang.String ATT_ITEM_TYPE
           
static java.lang.String ATT_REQUEST
           
static java.lang.String ATT_REQUESTER
           
static java.lang.String ATT_SYNCEXEC
           
static java.lang.String ATT_TIMEOUT
           
static java.lang.String code_id
           
static java.lang.String EL_DESCRIPTION
           
static java.lang.String EL_FORMREF
           
static java.lang.String EL_TASKREF
           
static java.lang.String EL_VARIABLES
           
static java.lang.String EL_VIEWS
           
static java.lang.String REVIEW
           
static java.lang.String SUSPEND
           
static java.lang.String VAR_COMMENTS
          The name of a variable that may be used to place explanitory comments in the work item.
static java.lang.String WIZARD
           
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
WorkItem()
          Build an empty work item.
WorkItem(org.w3c.dom.Element e)
          Build a work item from its XML representation.
 
Method Summary
protected  void addSubclassAttributes(java.lang.StringBuffer buf)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
protected  void addSubclassElements(java.lang.StringBuffer buf)
          Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist).
 void clearDirty()
          Clear the dirty flag.
 java.lang.String getActivityName()
          Get the name of the associated workflow process activity.
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 WFCase.Result getCaseResult()
           
 java.lang.String getDelegator()
          Get the delegator of this work item, if any.
 java.lang.String getDescription()
           
 Form getForm()
          Get the form for this work item.
 ObjectRef getFormRef()
          Get the form reference.
 java.lang.String getItemType()
           
 Form getLocalForm()
          Get the local form.
 java.lang.String getOwner()
          Get the owner of this item.
 java.lang.String getProcessName()
          Get the name of the associated workflow process.
 java.util.ArrayList getReferences()
          Return the list of references within this object.
 java.lang.String getRequest()
           
 java.lang.String getRequester()
           
 WSAttributes getSummaryAttributes()
           
 TaskInstance getTask()
          Get the resolved TaskInstance that contains our WorkflowCase.
 ObjectRef getTaskRef()
          Get a reference to the TaskInstance that contains our WorkflowCase.
 java.util.Date getTimeout()
          Get the work item timeout.
 java.lang.String getTrackingId()
          Get the optional tracking id.
 Type getType()
          Returns the associated Type object.
 java.lang.Object getVariable(Attribute attr)
          Get the value of a variable.
 java.lang.Object getVariable(java.lang.String name)
          Get the value of a variable.
 GenericObject getVariables()
          Get the entire variable table.
 java.util.List getViews()
           
 boolean isComplete()
          Test the completion state of the item.
 boolean isDirty()
          Test the dirty flag.
 boolean isIgnoreTimeout()
           
 boolean isSyncExec()
           
 java.util.List listQueryableAttributes()
           
 java.util.List listQueryableReferenceAttributes()
           
 java.util.List listSummaryAttributes()
          Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).
protected  void parseSubclassAttributes(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).
protected  void parseSubclassElements(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).
 void setActivityName(java.lang.String s)
          Get the name of the associated workflow process activity.
 void setCaseResult(WFCase.Result r)
           
 void setComplete(boolean b)
          Set the completion state of the item.
 void setDelegator(java.lang.String delegator)
           
 void setDescription(java.lang.String s)
           
 void setFormRef(ObjectRef ref)
          Set the form reference.
 void setIgnoreTimeout(boolean b)
           
 void setItemType(java.lang.String s)
           
 void setLocalForm(Form f)
          Set the local form.
 void setOwner(java.lang.String s)
          Set the owner of this item.
 void setProcessName(java.lang.String s)
          Set the name of the associated workflow process.
 void setRequest(java.lang.String s)
           
 void setRequester(java.lang.String s)
           
 void setSyncExec(boolean b)
           
 void setTask(TaskInstance t)
          Set the resolved TaskInstance that contains our WorkflowCase.
 void setTaskRef(ObjectRef ref)
          Set the reference to the TaskInstance that contains our WorkflowCase.
 void setTimeout(java.util.Date d)
          Set the work item timeout.
 void setTrackingId(java.lang.String id)
          Set an optional tracking ID.
 void setVariable(java.lang.String name, java.lang.Object value)
          Set one variable.
 void setVariables(GenericObject src)
          Bulk assignment of variables.
 void setViews(java.util.List views)
           
 void visit(Visitor v)
          Visitor interface.
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getDisplayName, getElementName, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

APPROVAL

public static final java.lang.String APPROVAL
See Also:
Constant Field Values

WIZARD

public static final java.lang.String WIZARD
See Also:
Constant Field Values

SUSPEND

public static final java.lang.String SUSPEND
See Also:
Constant Field Values

REVIEW

public static final java.lang.String REVIEW
See Also:
Constant Field Values

VAR_COMMENTS

public static final java.lang.String VAR_COMMENTS
The name of a variable that may be used to place explanitory comments in the work item. In releases prior to 2.0 this was used to pass information into the workflow report generator. Starting with 2.5, you should use the _request field instead.

See Also:
Constant Field Values

ATT_ITEM_TYPE

public static final java.lang.String ATT_ITEM_TYPE
See Also:
Constant Field Values

ATT_TIMEOUT

public static final java.lang.String ATT_TIMEOUT
See Also:
Constant Field Values

ATT_SYNCEXEC

public static final java.lang.String ATT_SYNCEXEC
See Also:
Constant Field Values

ATT_REQUEST

public static final java.lang.String ATT_REQUEST
See Also:
Constant Field Values

ATT_REQUESTER

public static final java.lang.String ATT_REQUESTER
See Also:
Constant Field Values

ATT_IGNORE_TIMEOUT

public static final java.lang.String ATT_IGNORE_TIMEOUT
See Also:
Constant Field Values

EL_TASKREF

public static final java.lang.String EL_TASKREF
See Also:
Constant Field Values

EL_VARIABLES

public static final java.lang.String EL_VARIABLES
See Also:
Constant Field Values

EL_FORMREF

public static final java.lang.String EL_FORMREF
See Also:
Constant Field Values

EL_DESCRIPTION

public static final java.lang.String EL_DESCRIPTION
See Also:
Constant Field Values

EL_VIEWS

public static final java.lang.String EL_VIEWS
See Also:
Constant Field Values
Constructor Detail

WorkItem

public WorkItem()
Build an empty work item.


WorkItem

public WorkItem(org.w3c.dom.Element e)
         throws WavesetException
Build a work item from its XML representation.

Method Detail

setCaseResult

public void setCaseResult(WFCase.Result r)

getType

public Type getType()
Returns the associated Type object.

Specified by:
getType in class PersistentObject

getReferences

public java.util.ArrayList getReferences()
Return the list of references within this object.

Overrides:
getReferences in class PersistentObject

visit

public void visit(Visitor v)
           throws WavesetException
Visitor interface.

Overrides:
visit in class PersistentObject
Throws:
WavesetException

getOwner

public java.lang.String getOwner()
Get the owner of this item.


setOwner

public void setOwner(java.lang.String s)
Set the owner of this item.

This will be set up originally by the workflow case, it may be changed after it has been created if you want to reassign the item to someone else. // *

// * Hmm, might want to use an ObjectRef here to support // * Administrator account rename.


getDelegator

public java.lang.String getDelegator()
Get the delegator of this work item, if any.


setDelegator

public void setDelegator(java.lang.String delegator)

getTimeout

public java.util.Date getTimeout()
Get the work item timeout.


setTimeout

public void setTimeout(java.util.Date d)
Set the work item timeout.


getTaskRef

public ObjectRef getTaskRef()
Get a reference to the TaskInstance that contains our WorkflowCase.


setTaskRef

public void setTaskRef(ObjectRef ref)
Set the reference to the TaskInstance that contains our WorkflowCase. This is used only once during construction, it should not be changed once the item has been stored.


getTask

public TaskInstance getTask()
                     throws WavesetException
Get the resolved TaskInstance that contains our WorkflowCase.

Throws:
WavesetException

setTask

public void setTask(TaskInstance t)
Set the resolved TaskInstance that contains our WorkflowCase. This is used only once during construction, it should not be changed once the item has been stored.


getProcessName

public java.lang.String getProcessName()
Get the name of the associated workflow process.


setProcessName

public void setProcessName(java.lang.String s)
Set the name of the associated workflow process. This is used only once during construction, it should not be changed once the item has been stored.


getActivityName

public java.lang.String getActivityName()
Get the name of the associated workflow process activity.


setActivityName

public void setActivityName(java.lang.String s)
Get the name of the associated workflow process activity. This is used only once during construction, it should not be changed once the item has been stored.


isComplete

public boolean isComplete()
Test the completion state of the item.


setComplete

public void setComplete(boolean b)
Set the completion state of the item.

This must be called by an application that provides a "work list" to the owner. The owner may decide to complete without modifying variables, modify variables without completing or both.


isDirty

public boolean isDirty()
Test the dirty flag.


clearDirty

public void clearDirty()
Clear the dirty flag. This should only be called by the workflow executor after it has analyzed the item. If applications call this, it could prevent changes from being assimilated and cause the workflow case to "stick".


setTrackingId

public void setTrackingId(java.lang.String id)
Set an optional tracking ID. This ID is one of the inline parameters and can be used in queries to find related WorkItems.


getTrackingId

public java.lang.String getTrackingId()
Get the optional tracking id. This ID is one of the inline parameters and can be used in queries to find related WorkItems.


getFormRef

public ObjectRef getFormRef()
Get the form reference.


setFormRef

public void setFormRef(ObjectRef ref)
Set the form reference.


getLocalForm

public Form getLocalForm()
Get the local form.


setLocalForm

public void setLocalForm(Form f)
Set the local form.


getForm

public Form getForm()
             throws WavesetException
Get the form for this work item. Use the local form if we have one, otherwise try to resolve the reference.

Throws:
WavesetException

setDescription

public void setDescription(java.lang.String s)

getDescription

public java.lang.String getDescription()

setSyncExec

public void setSyncExec(boolean b)

isSyncExec

public boolean isSyncExec()

getRequest

public java.lang.String getRequest()

setRequest

public void setRequest(java.lang.String s)

getRequester

public java.lang.String getRequester()

setRequester

public void setRequester(java.lang.String s)

setViews

public void setViews(java.util.List views)

getViews

public java.util.List getViews()

setIgnoreTimeout

public void setIgnoreTimeout(boolean b)

isIgnoreTimeout

public boolean isIgnoreTimeout()

getCaseResult

public WFCase.Result getCaseResult()

setItemType

public void setItemType(java.lang.String s)

getItemType

public java.lang.String getItemType()

setVariables

public void setVariables(GenericObject src)
Bulk assignment of variables.


getVariable

public java.lang.Object getVariable(Attribute attr)
Get the value of a variable.


getVariable

public java.lang.Object getVariable(java.lang.String name)
Get the value of a variable.


setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
Set one variable.


getVariables

public GenericObject getVariables()
Get the entire variable table. This should only be used by WorkflowExecutor, or something else that understands the inner Variable objects. Do NOT modify the map, use setVariable if you need to change something.


listSummaryAttributes

public java.util.List listSummaryAttributes()
Description copied from class: PersistentObject
Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.

Overrides:
listSummaryAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:
Constants.MAX_SUMMARY_STRING_LENGTH, PersistentObject.getSummaryString()

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listQueryableAttributes() to ensure that the subclass includes queryable attributes that are common to all PersistentObjects.


listQueryableReferenceAttributes

public java.util.List listQueryableReferenceAttributes()
Overrides:
listQueryableReferenceAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes and for which each value is a reference to another persistent object.

getSummaryAttributes

public WSAttributes getSummaryAttributes()
Overrides:
getSummaryAttributes in class PersistentObject
Returns:
attribute values to be displayed when this object appears in a list. The WSAttributes contains a WSAttribute for each summary attribute. Each WSAttribute may contain multiple values.

Any subclass of PersistentObject that overrides this method should first invoke super.getSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:

If a subclass wants to expose a different set of summary attributes, that subclass should override {@link #listSummaryAttributes}. In order to supply values for summary attributes that may not be available in PersistentObject (e.g., from a field specified to that subclass), such a subclass may also override {@link #getAttributeValues(Attribute)}.

A subclass should not need to override this method (except to limit the number of values for a summary attribute).


getAttributeValues

protected WSAttribute getAttributeValues(java.lang.String attrName)
Overrides:
getAttributeValues in class PersistentObject
Parameters:
attrName - - the name of the attribute for which to return values.
Returns:
a WSAttribute that represents the value (or values) that this object contains for the specified attribute.


addSubclassAttributes

protected void addSubclassAttributes(java.lang.StringBuffer buf)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.

Overrides:
addSubclassAttributes in class PersistentObject
See Also:


addSubclassElements

protected void addSubclassElements(java.lang.StringBuffer buf)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.

Overrides:
addSubclassElements in class PersistentObject
See Also:


parseSubclassAttributes

protected void parseSubclassAttributes(org.w3c.dom.Element e)
                                throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassAttributes in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

parseSubclassElements

protected void parseSubclassElements(org.w3c.dom.Element e)
                              throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassElements in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)