com.ibm.task.api
Interface Task

All Superinterfaces:
java.io.Serializable

public interface Task
extends java.io.Serializable

Accesses the properties of a task instance.

A task represents a piece of work. It contains all data that is necessary to get the job done. For example, a task that is associated to a group of potential owners allows a person that belongs to the group to claim the task, work on the task, and to complete the task.

Since:
6.0 - introduced in 5.1

Field Summary
static int AUTH_NONE
          States that no operations can be executed on the associated context.
static int AUTH_READER
          States that operations can be executed on the associated context object that require Reader authority, for example, reading the properties of a process instance.
static java.lang.String COPYRIGHT
           
static int KIND_ADMINISTRATIVE
          States that the task is an administrative task.
static int KIND_HUMAN
          States that the task is created and processed by a human.
static int KIND_ORIGINATING
          States that the task is a machine task whose service is invoked and tracked by the task manager.
static int KIND_PARTICIPATING
          States that the task is a human task tracked by the task manager.
static int KIND_WPC_STAFF_ACTIVITY
          States that the task is a human task controlled by BFM.
static int STATE_CLAIMED
          States that the task has been claimed.
static int STATE_EXPIRED
          States that the task ended because its allowed duration timed-out.
static int STATE_FAILED
          States that the task failed to execute.
static int STATE_FAILING
          States that the WPC_STAFF_ACTIVITY is failing.
static int STATE_FINISHED
          States that the task finished execution successfully.
static int STATE_FORWARDED
          States that the task has been completed with a follow-on task.
static int STATE_INACTIVE
          States that the WPC_STAFF_ACTIVITY has not yet been scheduled for execution.
static int STATE_PROCESSING_UNDO
          States that the WPC_STAFF_ACTIVITY is retried due to a transaction rollback and that the WPC_STAFF_ACTIVITY waits for the microflow that it invokes to complete its compensation actions for the first invoke.
static int STATE_READY
          States that the WPC_STAFF_ACTIVITY is ready to be started.
static int STATE_RUNNING
          States that the machine task is started and running.
static int STATE_SKIPPED
          States that the WPC_STAFF_ACTIVITY has been skipped because navigation followed a a different control path.
static int STATE_STOPPED
          States that the WPC_STAFF_ACTIVITY is stopped because of a failure.
static int STATE_TERMINATED
          States that the task has been terminated because of an external or internal request.
static int STATE_TERMINATING
          States that the WPC_STAFF_ACTIVITY is terminating.
static int STATE_WAITING
          States that a receive or pick WPC_STAFF_ACTIVITY is waiting for a corresponding event to occur.
 
Method Summary
 java.util.Calendar getActivationTime()
          Returns the time the task instance is set into the ready state.
 ACOID getApplicationDefaultsID()
          Returns the ID of the application component that specifies the defaults for the task.
 java.lang.String getCalendarName()
          Returns the name of the calendar used, for example, for expiration calculations.
 java.util.Calendar getCompletionTime()
          Returns the time when the task instance reached an end state.
 com.ibm.bpe.api.OID getContainmentContextID()
          Returns the ID of the context which embraces the task instance.
 int getContextAuthorizationOfOwner()
          Returns the authorization rights of the task owner to the associated context.
 java.lang.String getDescription(java.util.Locale arg0)
          Returns the description in the specified locale.
 java.lang.String getDisplayName(java.util.Locale arg0)
          Returns the display name in the specified locale.
 java.util.Calendar getDueTime()
          Returns the time when the task is due.
 java.lang.String getDurationUntilDeleted()
          Returns the duration until the task gets deleted after it reached an end state.
 java.lang.String getDurationUntilDue()
          Returns the duration until the task becomes due.
 java.lang.String getDurationUntilExpires()
          Returns the duration until the task expires once it is activated.
 java.lang.String getEventHandlerName()
          Returns the name of the associated event handler.
 java.util.Calendar getExpirationTime()
          Returns the time when the task instance will expire or was due to expire.
 java.util.Calendar getFirstActivationTime()
          Returns the time the task instance is set into the ready state for the first time.
 TKIID getFollowOnTaskID()
          Returns the object ID of the next task instance in a sequence.
 TKIID getID()
          Returns the object identifier.
 java.lang.String getInputMessageTypeName()
          Deprecated. Use createInputMessage. which does not require a type parameter instead of createMessage.
 java.lang.String getJNDINameOfCalendar()
          Returns the JNDI name of a user-defined calendar.
 java.lang.String getJNDINameOfStaffPluginProvider()
          Returns the JNDI name of a user-defined staff plugin.
 int getKind()
          Returns the kind of the task.
 java.util.Calendar getLastModificationTime()
          Returns the last time a property of the task instance changed.
 java.util.Calendar getLastStateChangeTime()
          Returns the last time the state of the task instance changed.
 java.util.List getLocalesOfDescriptions()
          Returns the locales of all descriptions.
 java.util.List getLocalesOfDisplayNames()
          Returns the locales of all display names.
 java.lang.String getName()
          Returns the name of the task instance.
 java.lang.String getNamespace()
          Returns the namespace of the task name and type properties.
 java.lang.String getOriginator()
          Returns the user ID of the user that created the task instance or on whose behalf the task instance was created.
 java.lang.String getOutputMessageTypeName()
          Deprecated. Use createOutputMessage. createOutputMessage() which does not require a type parameter instead of createMessage.
 java.lang.String getOwner()
          Returns the owner of the task instance.
 com.ibm.bpe.api.OID getParentContextID()
          Returns the ID of the parent application component.
 java.lang.Integer getPriority()
          Returns the priority of the task instance.
 java.lang.String getStarter()
          Returns the starter of the task instance.
 java.util.Calendar getStartTime()
          Returns the time when execution of the task started.
 int getState()
          Returns the state of the task instance.
 TKTID getTaskTemplateID()
          Returns the object ID of the task template this instance is derived from.
 java.lang.String getTaskTemplateName()
          Returns the name of the task template this instance is derived from.
 TKIID getTopLevelTaskID()
          Returns the object ID of the topmost task instance in the hierarchy.
 java.lang.String getType()
          Returns the type of the task.
 boolean isAdHoc()
          States whether the task has been created ad-hoc.
 boolean isBusinessRelevant()
          States whether the task is a business relevant or an "auxiliary" step.
 boolean isEscalated()
          States whether an escalation occurred.
 boolean isInline()
          States whether the task is an inline WPC_STAFF_ACTIVITY or not.
 boolean isSuspended()
          States whether the task instance is suspended or not.
 boolean isWaitingForSubTask()
          States whether the task is waiting for the completion of a subtask.
 void setBusinessRelevance(boolean businessRelevance)
          Sets whether the task is a business relevant or an "auxiliary" step.
 void setContextAuthorizationOfOwner(int contextAuthorization)
          Sets the authorization rights of the task owner to the associated context.
 void setDescription(java.lang.String description, java.util.Locale locale)
          Sets the description in the specified locale.
 void setDisplayName(java.lang.String displayName, java.util.Locale locale)
          Sets the display name in the specified locale.
 void setDurationUntilDeleted(java.lang.String durationUntilDeleted)
          Sets the duration until the task gets deleted after it reached an end state.
 void setDurationUntilDue(java.lang.String durationUntilDue)
          Sets the duration the task is expected to become due.
 void setEventHandlerName(java.lang.String eventHandlerName)
          Sets the name of the associated event handler.
 void setName(java.lang.String name)
          Sets the name of the task instance.
 void setNamespace(java.lang.String namespace)
          Sets the namespace for the task name and type properties.
 void setParentContextID(com.ibm.bpe.api.OID parentContextID)
          Sets the ID of the parent application component.
 void setPriority(java.lang.Integer priority)
          Sets the priority of the task instance.
 void setSupportsClaimIfSuspended(boolean supportsClaimSuspended)
          Sets whether the task can be claimed if it is suspended.
 void setSupportsDelegation(boolean supportsDelegation)
          Sets whether the task supports delegation, for example, by transferring work items.
 void setSupportsSubTasks(boolean supportsSubTask)
          Sets whether the task supports creation of subtasks and follow-on tasks.
 void setType(java.lang.String type)
          Sets the type of the task instance.
 boolean supportsAutomaticClaim()
          States whether the task is claimed automatically when it becomes ready.
 boolean supportsClaimIfSuspended()
          States whether the task can be claimed even if it is suspended.
 boolean supportsDelegation()
          States whether the task supports delegation, for example, by transferring work items.
 boolean supportsSubTasks()
          States whether the task supports creation of subtasks and follow-on tasks.
 

Field Detail

COPYRIGHT

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

STATE_TERMINATED

public static final int STATE_TERMINATED
States that the task has been terminated because of an external or internal request.

See Also:
Constant Field Values

STATE_READY

public static final int STATE_READY
States that the WPC_STAFF_ACTIVITY is ready to be started.

See Also:
Constant Field Values

STATE_EXPIRED

public static final int STATE_EXPIRED
States that the task ended because its allowed duration timed-out.

See Also:
Constant Field Values

STATE_CLAIMED

public static final int STATE_CLAIMED
States that the task has been claimed.

See Also:
Constant Field Values

STATE_INACTIVE

public static final int STATE_INACTIVE
States that the WPC_STAFF_ACTIVITY has not yet been scheduled for execution.

See Also:
Constant Field Values

STATE_PROCESSING_UNDO

public static final int STATE_PROCESSING_UNDO
States that the WPC_STAFF_ACTIVITY is retried due to a transaction rollback and that the WPC_STAFF_ACTIVITY waits for the microflow that it invokes to complete its compensation actions for the first invoke.

See Also:
Constant Field Values

STATE_SKIPPED

public static final int STATE_SKIPPED
States that the WPC_STAFF_ACTIVITY has been skipped because navigation followed a a different control path.

See Also:
Constant Field Values

STATE_FAILED

public static final int STATE_FAILED
States that the task failed to execute.

See Also:
Constant Field Values

STATE_STOPPED

public static final int STATE_STOPPED
States that the WPC_STAFF_ACTIVITY is stopped because of a failure. A process administrator can repair the WPC_STAFF_ACTIVITY by either calling forceRetry or forceComplete.

See Also:
Constant Field Values

STATE_RUNNING

public static final int STATE_RUNNING
States that the machine task is started and running.

See Also:
Constant Field Values

STATE_FINISHED

public static final int STATE_FINISHED
States that the task finished execution successfully.

See Also:
Constant Field Values

STATE_FAILING

public static final int STATE_FAILING
States that the WPC_STAFF_ACTIVITY is failing. The WPC_STAFF_ACTIVITY is set to the Failed execution state when all contained Running or Terminating activities end.

See Also:
Constant Field Values

STATE_WAITING

public static final int STATE_WAITING
States that a receive or pick WPC_STAFF_ACTIVITY is waiting for a corresponding event to occur.

See Also:
Constant Field Values

STATE_FORWARDED

public static final int STATE_FORWARDED
States that the task has been completed with a follow-on task.

See Also:
Constant Field Values

STATE_TERMINATING

public static final int STATE_TERMINATING
States that the WPC_STAFF_ACTIVITY is terminating. The WPC_STAFF_ACTIVITY is set to the Terminated execution state when all contained Running or Terminating activities end.

See Also:
Constant Field Values

KIND_WPC_STAFF_ACTIVITY

public static final int KIND_WPC_STAFF_ACTIVITY
States that the task is a human task controlled by BFM.

See Also:
Constant Field Values

KIND_PARTICIPATING

public static final int KIND_PARTICIPATING
States that the task is a human task tracked by the task manager.

See Also:
Constant Field Values

KIND_HUMAN

public static final int KIND_HUMAN
States that the task is created and processed by a human.

See Also:
Constant Field Values

KIND_ADMINISTRATIVE

public static final int KIND_ADMINISTRATIVE
States that the task is an administrative task.

See Also:
Constant Field Values

KIND_ORIGINATING

public static final int KIND_ORIGINATING
States that the task is a machine task whose service is invoked and tracked by the task manager.

See Also:
Constant Field Values

AUTH_READER

public static final int AUTH_READER
States that operations can be executed on the associated context object that require Reader authority, for example, reading the properties of a process instance.

See Also:
Constant Field Values

AUTH_NONE

public static final int AUTH_NONE
States that no operations can be executed on the associated context.

See Also:
Constant Field Values
Method Detail

getID

public TKIID getID()
Returns the object identifier.


getState

public int getState()
Returns the state of the task instance. Possible states are: STATE_INACTIVE, STATE_READY, STATE_RUNNING, STATE_FINISHED, STATE_FAILED, STATE_TERMINATED, STATE_CLAIMED, STATE_EXPIRED.


isSuspended

public boolean isSuspended()
States whether the task instance is suspended or not. Returns true when the task is suspended. Returns false when the task is not suspended.


isAdHoc

public boolean isAdHoc()
States whether the task has been created ad-hoc. True states that the task has been created ad-hoc. False states that the task has been derived from a task template.


isInline

public boolean isInline()
States whether the task is an inline WPC_STAFF_ACTIVITY or not. True states that the task is an inline WPC_STAFF_ACTIVITY. False states that the task is not an inline WPC_STAFF_ACTIVITY.


getActivationTime

public java.util.Calendar getActivationTime()
Returns the time the task instance is set into the ready state. If the task is not yet activated, a null object is returned. The activation time changes each time the task is set into the ready state, for example, when it is claimed and when the claim is cancelled.


getFirstActivationTime

public java.util.Calendar getFirstActivationTime()
Returns the time the task instance is set into the ready state for the first time. If the task is not yet activated, a null object is returned.


getCompletionTime

public java.util.Calendar getCompletionTime()
Returns the time when the task instance reached an end state. If the task instance is not yet completed, a null object is returned.


getLastModificationTime

public java.util.Calendar getLastModificationTime()
Returns the last time a property of the task instance changed.


getLastStateChangeTime

public java.util.Calendar getLastStateChangeTime()
Returns the last time the state of the task instance changed.


getExpirationTime

public java.util.Calendar getExpirationTime()
Returns the time when the task instance will expire or was due to expire. Returns a null object when there is no expiration time. This time is set when the expiration time is calculated. See getCompletionTime for the time when the task was actually set into the expired state.


getOriginator

public java.lang.String getOriginator()
Returns the user ID of the user that created the task instance or on whose behalf the task instance was created. For example, returns the starter of a BPEL process.


getStarter

public java.lang.String getStarter()
Returns the starter of the task instance. Returns null when a starter is not assigned or when the task is not an originating task instance.


getOwner

public java.lang.String getOwner()
Returns the owner of the task instance. Returns null when an owner is not assigned.


getContainmentContextID

public com.ibm.bpe.api.OID getContainmentContextID()
Returns the ID of the context which embraces the task instance. This ID is used for task instance deletion. In other words, when the context is deleted, the task instance is also deleted. For example, a task instance associated to a BPEL process returns the containing process instance ID.


getParentContextID

public com.ibm.bpe.api.OID getParentContextID()
Returns the ID of the parent application component. For example, the parent of a BPEL staff activity is the ID of the process instance directly containing the activity.


getName

public java.lang.String getName()
Returns the name of the task instance. Returns null if there is no name.


getKind

public int getKind()
Returns the kind of the task.

Possible values are: KIND_HUMAN, KIND_ORIGINATING, KIND_PARTICIPATING, KIND_ADMINISTRATIVE, KIND_WPC_STAFF_ACTIVITY.


getDisplayName

public java.lang.String getDisplayName(java.util.Locale arg0)
Returns the display name in the specified locale. If the requested display name is not found on the task instance, the task template display name is returned.

This method returns the display name in the default locale when a display name in the specified locale is not found. If no locale is specified, the display name in the default locale is returned or any available display name, if there is only a single display name.

Parameters:
arg0 - The locale for which the display name is to be provided.

getLocalesOfDisplayNames

public java.util.List getLocalesOfDisplayNames()
Returns the locales of all display names. Returns an empty list when there are no display names.


getDescription

public java.lang.String getDescription(java.util.Locale arg0)
Returns the description in the specified locale. If the requested description is not found on the task instance, the task template description is returned.

This method returns the description in the default locale when a description in the specified locale is not found. If no locale is specified, the description in the default locale is returned or any available description, if there is only a single description. References to variable members specified as %variableName.memberName% are resolved.

Parameters:
arg0 - The locale for which the description is to be provided.

getLocalesOfDescriptions

public java.util.List getLocalesOfDescriptions()
Returns the locales of all descriptions. Returns an empty list when there are no descriptions.


isBusinessRelevant

public boolean isBusinessRelevant()
States whether the task is a business relevant or an "auxiliary" step. A business relevant step can, for example, be logged into the audit trail.


getInputMessageTypeName

public java.lang.String getInputMessageTypeName()
Deprecated. Use createInputMessage. which does not require a type parameter instead of createMessage.

Returns the name of the input message type.


getOutputMessageTypeName

public java.lang.String getOutputMessageTypeName()
Deprecated. Use createOutputMessage. createOutputMessage() which does not require a type parameter instead of createMessage.

Returns the name of the output message type.


getApplicationDefaultsID

public ACOID getApplicationDefaultsID()
Returns the ID of the application component that specifies the defaults for the task. If the task is derived from a template, then the information in the template overwrites the defaults provided by the application component.


supportsAutomaticClaim

public boolean supportsAutomaticClaim()
States whether the task is claimed automatically when it becomes ready. Note that the task is claimed automatically only when there is a single potential owner.


getCalendarName

public java.lang.String getCalendarName()
Returns the name of the calendar used, for example, for expiration calculations. If not set, null is returned and the WebSphere default calendar is used. If a JNDI name for a user-defined calendar is specified, then the calendar name is the name of a method implementing that user-defined calendar - see getJNDINameOfCalendar.

For details on calendars refer to the WebSphere Application Server documentation.


getJNDINameOfCalendar

public java.lang.String getJNDINameOfCalendar()
Returns the JNDI name of a user-defined calendar. If not set, null is returned and a WebSphere supported calendar is used - see getCalendarName.

For details on calendars refer to the WebSphere Application Server documentation.


getDueTime

public java.util.Calendar getDueTime()
Returns the time when the task is due. The task manager does, however, not check whether a task is overdue. Instead, the escalation concept can be used to trigger notifications.


getDurationUntilDeleted

public java.lang.String getDurationUntilDeleted()
Returns the duration until the task gets deleted after it reached an end state. If not set, the task is deleted at once.


getDurationUntilDue

public java.lang.String getDurationUntilDue()
Returns the duration until the task becomes due. See getDueTime.


getDurationUntilExpires

public java.lang.String getDurationUntilExpires()
Returns the duration until the task expires once it is activated.


isEscalated

public boolean isEscalated()
States whether an escalation occurred.


getJNDINameOfStaffPluginProvider

public java.lang.String getJNDINameOfStaffPluginProvider()
Returns the JNDI name of a user-defined staff plugin.


getNamespace

public java.lang.String getNamespace()
Returns the namespace of the task name and type properties. Returns null if there is no namespace.


getPriority

public java.lang.Integer getPriority()
Returns the priority of the task instance. No special meaning is associated with this property. Escalations may, however, increase the priority of associated tasks. A caller can, for example, use it for sorting a list of tasks.


getStartTime

public java.util.Calendar getStartTime()
Returns the time when execution of the task started. This is, for example, the time when a human task is claimed or when a machine task starts running.


supportsDelegation

public boolean supportsDelegation()
States whether the task supports delegation, for example, by transferring work items.


supportsSubTasks

public boolean supportsSubTasks()
States whether the task supports creation of subtasks and follow-on tasks.


getTopLevelTaskID

public TKIID getTopLevelTaskID()
Returns the object ID of the topmost task instance in the hierarchy. If the current tasks instance is the topmost task instance itself, the object ID of the current task instance is returned.


getFollowOnTaskID

public TKIID getFollowOnTaskID()
Returns the object ID of the next task instance in a sequence. If there is no follow-on task instance, null is returned.


getTaskTemplateID

public TKTID getTaskTemplateID()
Returns the object ID of the task template this instance is derived from. Returns null when the task is not derived from a template.


getTaskTemplateName

public java.lang.String getTaskTemplateName()
Returns the name of the task template this instance is derived from. Returns null when the task is not derived from a template.


getType

public java.lang.String getType()
Returns the type of the task. Returns null when there is no associated type.


isWaitingForSubTask

public boolean isWaitingForSubTask()
States whether the task is waiting for the completion of a subtask.


getContextAuthorizationOfOwner

public int getContextAuthorizationOfOwner()
Returns the authorization rights of the task owner to the associated context.

Possible values are: AUTH_NONE, AUTH_READER.


supportsClaimIfSuspended

public boolean supportsClaimIfSuspended()
States whether the task can be claimed even if it is suspended. True states that the task can be claimed if it is suspended. False states that the task cannot be claimed if it is suspended.


getEventHandlerName

public java.lang.String getEventHandlerName()
Returns the name of the associated event handler. Returns null if there is no event handler.


setDisplayName

public void setDisplayName(java.lang.String displayName,
                           java.util.Locale locale)
Sets the display name in the specified locale.

Parameters:
displayName - The new value of the display name.
locale - The locale for which the display name is set.

setDescription

public void setDescription(java.lang.String description,
                           java.util.Locale locale)
Sets the description in the specified locale.

Parameters:
description - The new value of the description.
locale - The locale for which the description is set.

setSupportsClaimIfSuspended

public void setSupportsClaimIfSuspended(boolean supportsClaimSuspended)
Sets whether the task can be claimed if it is suspended.

Parameters:
supportsClaimSuspended - An indication whether the task can be claimed even if it is suspended. True states that the task can be claimed if it is suspended. False states that the task cannot be claimed if it is suspended.

setContextAuthorizationOfOwner

public void setContextAuthorizationOfOwner(int contextAuthorization)
Sets the authorization rights of the task owner to the associated context.

Parameters:
contextAuthorization - The authorization rights of the task owner for the associated context.

Possible values are: AUTH_NONE, AUTH_READER.


setName

public void setName(java.lang.String name)
Sets the name of the task instance.

Parameters:
name - The new name of the task instance.

setNamespace

public void setNamespace(java.lang.String namespace)
Sets the namespace for the task name and type properties.

Parameters:
namespace - The new namespace of the task instance.

setDurationUntilDue

public void setDurationUntilDue(java.lang.String durationUntilDue)
Sets the duration the task is expected to become due. This duration is informal only and not used for scheduling. See also getDueTime.

Parameters:
durationUntilDue - The duration when the task instance is expected to become due.

setDurationUntilDeleted

public void setDurationUntilDeleted(java.lang.String durationUntilDeleted)
Sets the duration until the task gets deleted after it reached an end state.

Parameters:
durationUntilDeleted - The duration when the task instance is finally deleted.

setPriority

public void setPriority(java.lang.Integer priority)
Sets the priority of the task instance. No special meaning is associated with this property. But a caller can, for example, use it for sorting a list of tasks.

Parameters:
priority - The priority of the task instance.

setType

public void setType(java.lang.String type)
Sets the type of the task instance.

Parameters:
type - The type of the task instance.

setSupportsDelegation

public void setSupportsDelegation(boolean supportsDelegation)
Sets whether the task supports delegation, for example, by transferring work items.

Parameters:
supportsDelegation - An indication whether the task instance supports delegation. True states that the task supports delegation. False states that the task does not support delegation.

setSupportsSubTasks

public void setSupportsSubTasks(boolean supportsSubTask)
Sets whether the task supports creation of subtasks and follow-on tasks.

Parameters:
supportsSubTask - An indication whether the task instance supports creation of subtasks and follow-on tasks. True states that the task supports creation of subtasks and follow-on tasks. False states that the task does not support creation of subtasks and follow-on tasks.

setBusinessRelevance

public void setBusinessRelevance(boolean businessRelevance)
Sets whether the task is a business relevant or an "auxiliary" step. A business relevant step can, for example, be logged into the audit trail.

Parameters:
businessRelevance - An indication whether the task instance is business relevant. True states that the task is business relevant. False states that the task is not business relevant.

setEventHandlerName

public void setEventHandlerName(java.lang.String eventHandlerName)
Sets the name of the associated event handler.

Parameters:
eventHandlerName - The name of the event handler to be associated.

setParentContextID

public void setParentContextID(com.ibm.bpe.api.OID parentContextID)
Sets the ID of the parent application component.

Parameters:
parentContextID - The object ID of the parent application component.