com.waveset.object
Class WorkItem

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

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/interfaces 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 ATT_TRANSIENT
           
static java.lang.String code_id
           
static java.lang.String EL_DELEGATORS
           
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
INITIAL_OBJECT_VERSION
 
Constructor Summary
WorkItem()
          Build an empty work item.
WorkItem(org.w3c.dom.Element e)
          Build a work item from its XML representation.
 
Method Summary
 void clearDirty()
          Clear the dirty flag.
 java.lang.String getActivityName()
          Get the name of the associated workflow process activity.
 com.waveset.object.WFCase.Result getCaseResult()
           
 java.util.List getDelegatorRefs()
          Get the delegators (list of User ObjectRefs) of this work item, if any.
 java.lang.String getDescription()
           
 com.waveset.object.Form getForm()
          Get the form for this work item.
 com.waveset.object.ObjectRef getFormRef()
          Get the form reference.
 java.lang.String getItemType()
           
 com.waveset.object.Form getLocalForm()
          Get the local form.
 java.lang.String getOwner()
          Get the owner of this item.
 com.sun.idm.object.IDMObjectClass getPrimaryObjectClass()
           
 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()
           
 java.lang.String getTargetId()
          Get the optional target id.
 java.lang.String getTargetName()
          Get the optional target id.
 java.lang.String getTargetObjectClass()
          Get the optional target object class name.
 com.waveset.object.TaskInstance getTask()
          Get the resolved TaskInstance that contains our WorkflowCase.
 com.waveset.object.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.
 com.waveset.object.Type getType()
          Returns the associated Type object.
 java.lang.Object getVariable(com.waveset.object.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 isAutoCompleted()
          Can this work item be completed manually?
 boolean isComplete()
          Test the completion state of the item.
 boolean isDirty()
          Test the dirty flag.
 boolean isIgnoreTimeout()
           
 boolean isSyncExec()
           
 boolean isTransient()
           
 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).
 void setActivityName(java.lang.String s)
          Get the name of the associated workflow process activity.
 void setAutoCompleted(boolean b)
          Set the autoCompleted state of the item.
 void setCaseResult(com.waveset.object.WFCase.Result r)
           
 void setComplete(boolean b)
          Set the completion state of the item.
 void setDelegatorRefs(java.util.List delegatorRefs)
          Set the delegators (list of User ObjectRefs) of this work item, if any
 void setDescription(java.lang.String s)
           
 void setFormRef(com.waveset.object.ObjectRef ref)
          Set the form reference.
 void setIgnoreTimeout(boolean b)
           
 void setItemType(java.lang.String s)
           
 void setLocalForm(com.waveset.object.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 setTargetId(java.lang.String id)
          Set an optional target ID.
 void setTargetName(java.lang.String name)
          Set an optional target name.
 void setTargetObjectClass(java.lang.String name)
          Set an optional target object class name.
 void setTask(com.waveset.object.TaskInstance t)
          Set the resolved TaskInstance that contains our WorkflowCase.
 void setTaskRef(com.waveset.object.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 setTransient(boolean b)
           
 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(com.waveset.object.Visitor v)
          Visitor interface.
 
Methods inherited from class com.waveset.object.PersistentObject
addMemberObjectGroup, addMemberObjectGroup, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, 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, getRepositoryMod, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryString, getXMLSize, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, objectGroupMember, objectGroupMemberRef, prepareForSerialization, prepareToSerialize, reEncrypt, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setDisplayName, setDisplayName, setHidden, setIsAlias, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

APPROVAL

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

ATT_IGNORE_TIMEOUT

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

ATT_ITEM_TYPE

public static final java.lang.String ATT_ITEM_TYPE
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_SYNCEXEC

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

ATT_TIMEOUT

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

ATT_TRANSIENT

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

code_id

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

EL_DELEGATORS

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

EL_DESCRIPTION

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

EL_FORMREF

public static final java.lang.String EL_FORMREF
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_VIEWS

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

REVIEW

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

SUSPEND

public static final java.lang.String SUSPEND
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

WIZARD

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

WorkItem

public WorkItem()
Build an empty work item.


WorkItem

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

Parameters:
e - xml element
Throws:
com.waveset.util.WavesetException - if e can't be parsed.
Method Detail

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".


getActivityName

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


getCaseResult

public com.waveset.object.WFCase.Result getCaseResult()

getDelegatorRefs

public java.util.List getDelegatorRefs()
Get the delegators (list of User ObjectRefs) of this work item, if any.


getDescription

public java.lang.String getDescription()

getForm

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

Throws:
com.waveset.util.WavesetException

getFormRef

public com.waveset.object.ObjectRef getFormRef()
Get the form reference.


getItemType

public java.lang.String getItemType()

getLocalForm

public com.waveset.object.Form getLocalForm()
Get the local form.


getOwner

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


getPrimaryObjectClass

public com.sun.idm.object.IDMObjectClass getPrimaryObjectClass()
Overrides:
getPrimaryObjectClass in class PersistentObject
Returns:
primary object class for this persistent object, possibly null.

getProcessName

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


getReferences

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

Overrides:
getReferences in class PersistentObject

getRequest

public java.lang.String getRequest()

getRequester

public java.lang.String getRequester()

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(String)}.

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


getTargetId

public java.lang.String getTargetId()
Get the optional target id.


getTargetName

public java.lang.String getTargetName()
Get the optional target id.


getTargetObjectClass

public java.lang.String getTargetObjectClass()
Get the optional target object class name.


getTask

public com.waveset.object.TaskInstance getTask()
                                        throws com.waveset.util.WavesetException
Get the resolved TaskInstance that contains our WorkflowCase.

Throws:
com.waveset.util.WavesetException

getTaskRef

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


getTimeout

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


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.


getType

public com.waveset.object.Type getType()
Returns the associated Type object.

Specified by:
getType in class PersistentObject
Returns:
type of this persistent object.

getVariable

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


getVariable

public java.lang.Object getVariable(java.lang.String name)
Get the value of a 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.


getViews

public java.util.List getViews()

isAutoCompleted

public boolean isAutoCompleted()
Can this work item be completed manually?


isComplete

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


isDirty

public boolean isDirty()
Test the dirty flag.


isIgnoreTimeout

public boolean isIgnoreTimeout()

isSyncExec

public boolean isSyncExec()

isTransient

public boolean isTransient()

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.

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()

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.


setAutoCompleted

public void setAutoCompleted(boolean b)
Set the autoCompleted state of the item.


setCaseResult

public void setCaseResult(com.waveset.object.WFCase.Result r)

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.


setDelegatorRefs

public void setDelegatorRefs(java.util.List delegatorRefs)
Set the delegators (list of User ObjectRefs) of this work item, if any

Parameters:
delegators -

setDescription

public void setDescription(java.lang.String s)

setFormRef

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


setIgnoreTimeout

public void setIgnoreTimeout(boolean b)

setItemType

public void setItemType(java.lang.String s)

setLocalForm

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


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.


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.


setRequest

public void setRequest(java.lang.String s)

setRequester

public void setRequester(java.lang.String s)

setSyncExec

public void setSyncExec(boolean b)

setTargetId

public void setTargetId(java.lang.String id)
Set an optional target ID.


setTargetName

public void setTargetName(java.lang.String name)
Set an optional target name.


setTargetObjectClass

public void setTargetObjectClass(java.lang.String name)
Set an optional target object class name.


setTask

public void setTask(com.waveset.object.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.


setTaskRef

public void setTaskRef(com.waveset.object.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.


setTimeout

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


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.


setTransient

public void setTransient(boolean b)

setVariable

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


setVariables

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


setViews

public void setViews(java.util.List views)

visit

public void visit(com.waveset.object.Visitor v)
           throws com.waveset.util.WavesetException
Visitor interface.

Overrides:
visit in class PersistentObject
Parameters:
v - Visitor for this persistent object.
Throws:
com.waveset.util.WavesetException - if there's a problem from visitPersistentObject