com.bea.wli.worklist.api
Interface WorklistTaskUser


public interface WorklistTaskUser

User functions relating to worklist tasks

Since:
9.2

Method Summary
 void claimTask(String taskId)
          Claim the task for the caller.
 void claimTaskForUser(String taskId, String user)
          Claim the task on the behalf of a specific user.
 TaskData getTask(String taskId)
          Get the TaskData object describing persistent information about the task with the given id.
 TaskData getTask(String taskId, boolean includeUserProperties)
          Get the TaskData object describing persistent information about the task with the given id, optionally including user properties in the returned data.
 TaskData getTaskAtDate(String taskId, Date date)
          Get the state of a task as it would have appeared on the given date.
 TaskEventHistory[] getTaskEvents(String taskId, Date startDate, Date endDate)
          Get all events that have occurred, sorted by date, on this task from the start date to the end date (inclusive).
 TaskPlan getTaskPlanForTask(String taskId)
          Get the TaskPlan for the given task
 TaskPlan getTaskPlanForTask(TaskData taskData)
          Get the TaskPlan for the given task.
 Map getTaskProperties(String taskId)
          Get all defined properties (user and system) from a task.
 Map getTaskProperties(String taskId, Property[] props)
          Get one or more properties from a task.
 Map getTaskProperties(String taskId, String[] propNames, boolean includeValues)
          Get one or more properties from a task.
 Map getTaskPropertiesForStepAction(String taskId, String stepName, String stepActionName)
          Get the properties that are required for taking the specified action from the specified step.
 PropertyInstance getTaskProperty(String taskId, Property prop)
          Get a property from a task.
 boolean isTaskHistoryProvided(TaskPlanId taskPlanID)
          Is the task plan associated with a task history provider.
 void returnTask(String taskId)
          Return a task that is in the state CLAIMED to the state ASSIGNED with all the previous assignees.
 void setTaskComment(String taskId, String comment)
          Set a task comment.
 void setTaskProperties(String taskId, Map propMap)
          Set one or more properties on a task
 void setTaskProperty(String taskId, PropertyInstance prop)
          Set a property on a task.
 void takeActionOnTask(String taskId, String currentStepName, String stepActionName, Map propMap)
          Take an action on the current step for the task given by the taskId.
 void takeActionOnTaskAndClaim(String taskId, String currentStepName, String stepActionName, Map propMap, String postActionClaimant)
          Take an action on the current step for the task given by the taskId, and then claim the task in the name of the given user.
 

Method Detail

getTask

TaskData getTask(String taskId)
                 throws ManagementException,
                        RemoteException
Get the TaskData object describing persistent information about the task with the given id. Note that user properties are not included in the returned TaskData. You must make a separate call to getTaskProperties() or call getTask(String, boolean) instead.

Throws:
ManagementException - if no task with the given ID can be found or some other processing error occurs.
RemoteException

getTask

TaskData getTask(String taskId,
                 boolean includeUserProperties)
                 throws ManagementException,
                        RemoteException
Get the TaskData object describing persistent information about the task with the given id, optionally including user properties in the returned data.

Throws:
ManagementException - if no task with the given ID can be found or some other processing error occurs.
RemoteException

getTaskPlanForTask

TaskPlan getTaskPlanForTask(String taskId)
                            throws ManagementException,
                                   RemoteException
Get the TaskPlan for the given task

Parameters:
taskId - The ID for the task for which the task plan will be retrieved.
Returns:
TaskPlan instance for the task plan (never null).
Throws:
ManagementException - If the task plan is not found, or any other error occurs retrieving the task plan.
RemoteException

getTaskPlanForTask

TaskPlan getTaskPlanForTask(TaskData taskData)
                            throws ManagementException,
                                   RemoteException
Get the TaskPlan for the given task. The task data should contain creator, owner, claimant and assignee list for it to be validated.

Parameters:
taskData - The task data holder for the task for which the task plan will be retrieved.
Returns:
TaskPlan instance for the task plan (never null).
Throws:
ManagementException - If the task plan is not found, or any other error occurs retrieving the task plan.
RemoteException

setTaskComment

void setTaskComment(String taskId,
                    String comment)
                    throws ManagementException,
                           RemoteException
Set a task comment.

Parameters:
comment -
taskId -
Throws:
ManagementException
RemoteException

setTaskProperty

void setTaskProperty(String taskId,
                     PropertyInstance prop)
                     throws ManagementException,
                            DataTypeException,
                            RemoteException
Set a property on a task.

Throws:
ManagementException
DataTypeException
RemoteException

setTaskProperties

void setTaskProperties(String taskId,
                       Map propMap)
                       throws ManagementException,
                              RemoteException
Set one or more properties on a task

Parameters:
taskId -
propMap - A map of property name (String) to PropertyInstance where PropertyInstance holds the value for the property.
Throws:
ManagementException
RemoteException

getTaskProperty

PropertyInstance getTaskProperty(String taskId,
                                 Property prop)
                                 throws ManagementException,
                                        RemoteException
Get a property from a task. If you are interested in performance from remote clients (different VMs or different apps) you should use getTaskProperties(String, String[], boolean), passing just the names of the properties to retrieve.
NOTE: The caller is assumed to have access to any custom classes needed for the properties being fetched here. For example if the property is an XMLBean property, the caller must have access to the XMLBean class referenced in the property's data type variant info. If not, a ManagementException is thrown.

Throws:
ManagementException
RemoteException

getTaskProperties

Map getTaskProperties(String taskId)
                      throws ManagementException,
                             RemoteException
Get all defined properties (user and system) from a task. If you want to get just user properties, call getTaskProperties(String, Property[]) passing the Property[] with properties returned from TaskPlan.getPropertyContainer().getChildObjects().toArray(new Property[]). If you are interested in performance from remote clients (different VMs or different apps) you should use getTaskProperties(String, String[], boolean), passing just the names of the properties to retrieve.
NOTE: The caller is assumed to have access to any custom classes needed for the properties being fetched here. For example if the property is an XMLBean property, the caller must have access to the XMLBean class referenced in the property's data type variant info. If not, a ManagementException is thrown.

Parameters:
taskId -
Returns:
A map of property name (String) to PropertyInstance where PropertyInstance holds the value for the property.
Throws:
ManagementException
RemoteException
See Also:
getTaskProperties(String, Property[]), TaskPlan.getPropertyContainer(), NamedObjectContainer.getChildObjects()

getTaskProperties

Map getTaskProperties(String taskId,
                      Property[] props)
                      throws ManagementException,
                             RemoteException
Get one or more properties from a task. If you want to get just user properties, call this method passing the Property[] with properties returned from TaskPlan.getPropertyContainer().getChildObjects().toArray(new Property[]). Note that if you are interested in performance from remote clients (different VMs or different apps), you should use getTaskProperties(String, String[], boolean), passing just the names of the properties you are interested in.
NOTE: The caller is assumed to have access to any custom classes needed for the properties being fetched here. For example if the property is an XMLBean property, the caller must have access to the XMLBean class referenced in the property's data type variant info. If not, a ManagementException is thrown.

Parameters:
taskId -
props -
Returns:
A map of property name (String) to PropertyInstance where PropertyInstance holds the value for the property.
Throws:
ManagementException
RemoteException
See Also:
getTaskProperties(String, String[], boolean), TaskPlan.getPropertyContainer(), NamedObjectContainer.getChildObjects()

getTaskProperties

Map getTaskProperties(String taskId,
                      String[] propNames,
                      boolean includeValues)
                      throws ManagementException,
                             UnknownObjectException,
                             RemoteException
Get one or more properties from a task.
NOTE: The caller is assumed to have access to any custom classes needed for the properties being fetched here. For example if the property is an XMLBean property, the caller must have access to the XMLBean class referenced in the property's data type variant info. If not, a ManagementException is thrown.

Parameters:
taskId -
propNames -
includeValues - If true, the returned PropertyInstance objects will have a value (if any is available) in them. If false, the current value of the property is not returned. This can be useful if you know the values are large and are going to be overwritten anyway.
Returns:
A map of property name (String) to PropertyInstance where PropertyInstance holds the value for the property.
Throws:
ManagementException
UnknownObjectException - If any property name doesn't match any valid/defined user or system property.
RemoteException

getTaskPropertiesForStepAction

Map getTaskPropertiesForStepAction(String taskId,
                                   String stepName,
                                   String stepActionName)
                                   throws ManagementException,
                                          UnknownObjectException,
                                          RemoteException
Get the properties that are required for taking the specified action from the specified step. Note that if you are interested in performance from remote clients (different VMs or different apps), you should use getTaskProperties(String, String[], boolean), passing just the names of the properties you are interested in. You can find the appropriate property names for the desired action by getting the StepAction from the Step, and then calling getPropertyNames on the action.
NOTE: The caller is assumed to have access to any custom classes needed for the properties being fetched here. For example if the property is an XMLBean property, the caller must have access to the XMLBean class referenced in the property's data type variant info. If not, a ManagementException is thrown.

Parameters:
taskId -
stepName -
stepActionName -
Returns:
Map (key=String, value=PropertyInstance) containing all properties needed to take the specified action, or null if none are required.
Throws:
ManagementException
UnknownObjectException - If the named step or step action cannot be found within the task plan for the given task.
RemoteException
See Also:
Action.getPropertyNames()

takeActionOnTask

void takeActionOnTask(String taskId,
                      String currentStepName,
                      String stepActionName,
                      Map propMap)
                      throws ManagementException,
                             UnknownObjectException,
                             AssignmentException,
                             RemoteException
Take an action on the current step for the task given by the taskId. The code below shows how to determine what the current step and action are:
 String taskId = ...;
 String actionName = ...;
 WorklistContext context = WorklistContext.getRemoteWorklistContext(...);
 WorklistTaskUser user = context.getInterfaceForTaskUser();
 TaskPlanRegistry registry = context.getTaskPlanRegistry();
 TaskData data = user.getTask(taskId);
 TaskPlan taskPlan = registry.getTaskPlan(data.getTaskPlanId());
 Step step = taskPlan.getStep(data.getCurrentStepName());
 StepAction action = step.getStepAction(actionName);
 

Parameters:
taskId -
currentStepName -
stepActionName -
propMap - A map of property name (String) to PropertyInstance objects representing properties needed for the indicated action. May be null if no properties are required. You can get this map from a call to getTaskPropertiesForStepAction.
Throws:
ManagementException
UnknownObjectException - If the named current step or step action cannot be found in the task plan.
AssignmentException
RemoteException

takeActionOnTaskAndClaim

void takeActionOnTaskAndClaim(String taskId,
                              String currentStepName,
                              String stepActionName,
                              Map propMap,
                              String postActionClaimant)
                              throws ManagementException,
                                     UnknownObjectException,
                                     AssignmentException,
                                     RemoteException
Take an action on the current step for the task given by the taskId, and then claim the task in the name of the given user. This method is used to support interactive assignment. The caller should have performed the interactive assignment ahead of calling this method (for example calling getCandidateUsers and making a choice for the new claimant). The code below shows how to determine what the current step and action are:
 String taskId = ...;
 String actionName = ...;
 WorklistContext context = WorklistContext.getRemoteWorklistContext(...);
 WorklistTaskUser user = context.getInterfaceForTaskUser();
 TaskPlanRegistry registry = context.getTaskPlanRegistry();
 TaskData data = user.getTask(taskId);
 TaskPlan taskPlan = registry.getTaskPlan(data.getTaskPlanId());
 Step step = taskPlan.getStep(data.getCurrentStepName());
 StepAction action = step.getStepAction(actionName);
 

Parameters:
taskId -
currentStepName -
stepActionName -
propMap - A map of property name (String) to PropertyInstance objects representing properties needed for the indicated action. May be null if no properties are required.
postActionClaimant - The name of the user that should be made the claimant after this action is complete.
Throws:
ManagementException
UnknownObjectException - If the named current step or step action cannot be found in the task plan.
AssignmentException
RemoteException

claimTask

void claimTask(String taskId)
               throws ManagementException,
                      RemoteException
Claim the task for the caller. The task will go from the state ASSIGNED to CLAIMED.

Parameters:
taskId - the taskId
Throws:
ManagementException - * @throws RemoteException
RemoteException

claimTaskForUser

void claimTaskForUser(String taskId,
                      String user)
                      throws ManagementException,
                             RemoteException
Claim the task on the behalf of a specific user. The caller must be the worklist admin or the task owner. The task will go from the state ASSIGNED to CLAIMED.

Parameters:
taskId -
user -
Throws:
ManagementException
RemoteException

returnTask

void returnTask(String taskId)
                throws ManagementException,
                       RemoteException
Return a task that is in the state CLAIMED to the state ASSIGNED with all the previous assignees.

Parameters:
taskId -
Throws:
ManagementException
RemoteException

isTaskHistoryProvided

boolean isTaskHistoryProvided(TaskPlanId taskPlanID)
                              throws ManagementException,
                                     RemoteException
Is the task plan associated with a task history provider. If this returns true, you can reasonably expect to get non-empty results from getTaskEvents().

Throws:
ManagementException
RemoteException

getTaskEvents

TaskEventHistory[] getTaskEvents(String taskId,
                                 Date startDate,
                                 Date endDate)
                                 throws ManagementException,
                                        RemoteException
Get all events that have occurred, sorted by date, on this task from the start date to the end date (inclusive). If no task history is available for this task, an empty array is returned. This may happen if the date range falls in during a period of inactivity for the task, or it may indicate that no task history information is being captured for tasks of this type.

Throws:
ManagementException
RemoteException

getTaskAtDate

TaskData getTaskAtDate(String taskId,
                       Date date)
                       throws NotSupportedException,
                              ManagementException,
                              RemoteException
Get the state of a task as it would have appeared on the given date.

Throws:
NotSupportedException
ManagementException
RemoteException