Class PCTaskHelper
java.lang.Object
com.webmethods.caf.portalclient.task.PCTaskHelper
Helper class which implements variety of TaskEngine API functions. This class
is a simple wrapper on top of
PortalClient
API used to facilitate
access to TaskEngine webServices port type. Prior using these API
PortalClient needs to be initialized by calling one of its initialize(...)
methods-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
countAllTasksIndexed
(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) Return the total result count for a task search against all tasksstatic int
countUserTasksIndexed
(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) Return the total result count for a user inbox task searchstatic void
deleteTask
(String user, String taskID) Deletes a taskstatic void
formFlowTaskNotify
(String correlationID, String result, boolean localOnly) Notify a task flow that a transition has occuredstatic RecalculationStatus
getRecalculationStatus
(String taskTypeId) Retrieve Recalculation status of task typestatic Task
Fetches task by its IDstatic String
Queues new task to the TaskEnginestatic Task[]
searchAllTasks
(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) Searches all tasksstatic Task[]
searchAllTasksIndexed
(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) Searches all tasks with pagingstatic TaskFields[]
searchFieldsAllTasks
(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) Searches all tasksstatic TaskFields[]
searchFieldsUserTasks
(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) Searches user inbox tasksstatic Task[]
searchUserTasks
(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) Searches user inbox tasksstatic Task[]
searchUserTasksIndexed
(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) Return a subset of user inbox search results.static String[]
setInstancesStatus
(String user, String taskTypeId, String status, Boolean logInFile, Integer batchSize) Updates all instances status for specific task typestatic void
startVoteRecalculation
(String user, String taskTypeID) Recalculates voting strategy for given task type and attempts a status transition where needed for each task instance of said typestatic void
stopVoteRecalculation
(String user, String taskTypeID) Cancels the ongoing voting strategy recalculation for a given task typestatic void
Updates an existing taskstatic void
Vote with a specific status for a certain task.
-
Constructor Details
-
PCTaskHelper
public PCTaskHelper()
-
-
Method Details
-
queueTask
public static String queueTask(String user, String taskTypeID, TaskInfo taskInfo, Hashtable<String, ?> taskData) throws ExceptionQueues new task to the TaskEngine- Parameters:
user
- (optional) UserID on behalf of whom new task will be queued. If null, then portal client session context userID will be usedtaskTypeID
- (required) task type ID as defined in the Task ApplicationtaskInfo
- (optional) Additional generic information for the new tasktaskData
- (optional) Additional business data for the new task- Returns:
- newly created taskID if successful
- Throws:
Exception
-
updateTask
public static void updateTask(String user, String taskID, TaskInfo taskInfo, Hashtable<String, ?> taskData) throws ExceptionUpdates an existing task- Parameters:
user
- (optional) UserID on behalf of whom task will be updated. If null, then portal client session context userID will be usedtaskID
- (required) TaskID to be updatedtaskInfo
- (optional) Generic task information to be set on the tasktaskData
- (optional) Business data information to be set on the task- Throws:
Exception
- if there is an error updating a task
-
deleteTask
Deletes a task- Parameters:
user
- (optional) UserID on behalf of whom task will be deleted. If null, then portal client session context userID will be usedtaskID
- (required) TaskID to be deleted- Throws:
Exception
- if there is an error deleting a task
-
getTask
Fetches task by its ID- Parameters:
user
- (optional) UserID on behalf of whom task will be fetched. If null, then portal client session context userID will be usedtaskID
- (required) TaskID to getincludeTaskData
- whether result should include task business data- Returns:
- Task filled with task generic info and task business data (if requested)
- Throws:
Exception
- if there is a problem getting task
-
searchAllTasks
public static Task[] searchAllTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) throws Exception Searches all tasks- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
searchUserTasks
public static Task[] searchUserTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) throws Exception Searches user inbox tasks- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
searchFieldsAllTasks
public static TaskFields[] searchFieldsAllTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) throws Exception Searches all tasks- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
searchFieldsUserTasks
public static TaskFields[] searchFieldsUserTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) throws Exception Searches user inbox tasks- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
searchAllTasksIndexed
public static Task[] searchAllTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception Searches all tasks with paging- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
countAllTasksIndexed
public static int countAllTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception Return the total result count for a task search against all tasks- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedbusinessData
- Specify true if the task search query requires examination of task business data- Returns:
- the number of tasks that would be returned by the user inbox task search
- Throws:
Exception
- if there is a problem searching for tasks
-
searchUserTasksIndexed
public static Task[] searchUserTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception Return a subset of user inbox search results.- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedincludeTaskData
- whether result should include task business data- Returns:
- list of matched tasks
- Throws:
Exception
- if there is a problem searching for tasks
-
countUserTasksIndexed
public static int countUserTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception Return the total result count for a user inbox task search- Parameters:
user
- (optional) UserID on behalf of whom tasks will be searched. If null, then portal client session context userID will be usedtaskSearchQuery
- (optional) task search query. If null all tasks will be returnedbusinessData
- Specify true if the task search query requires examination of task business data- Returns:
- the number of tasks that would be returned by the user inbox task search
- Throws:
Exception
- if there is a problem searching for tasks
-
formFlowTaskNotify
public static void formFlowTaskNotify(String correlationID, String result, boolean localOnly) throws Exception Notify a task flow that a transition has occured- Parameters:
correctionID
- the unique identifier of the form flowresult
- the result string to return to the task flow, usually the URL that the flow should navigate to nextlocalOnly
- only notify the local machine, do not sent notification events to other nodes in the MWS cluster- Throws:
Exception
-
setInstancesStatus
public static String[] setInstancesStatus(String user, String taskTypeId, String status, Boolean logInFile, Integer batchSize) throws Exception Updates all instances status for specific task type- Parameters:
user
- (required) UserID on behalf of whom task will be updated. If null, then portal client session context userID will be usedtaskTypeId
- (required) taskTypeId which instances to be updatedstatus
- (required) new statuslogInFile
- (optional) whether result should be logged in file or returned as responsebatchSize
- (optional) the total number of tasks instances that will be processed together- Throws:
Exception
- if there is an error updating all tasks status
-
startVoteRecalculation
Recalculates voting strategy for given task type and attempts a status transition where needed for each task instance of said type- Parameters:
user
- (required) UserID on behalf of whom task will be updated. If null, then portal client session context userID will be usedtaskTypeId
- (required) taskTypeId which Task Type to be recalculated- Throws:
Exception
- if there is an error during recalculation
-
stopVoteRecalculation
Cancels the ongoing voting strategy recalculation for a given task type- Parameters:
user
- (required) UserID on behalf of whom task will be updated. If null, then portal client session context userID will be usedtaskTypeID
- (required) taskTypeId which Task Type to be recalculated- Throws:
Exception
-
voteTask
Vote with a specific status for a certain task.- Parameters:
taskID
-status
-user
-
-
getRecalculationStatus
Retrieve Recalculation status of task type- Parameters:
taskTypeId
- (required) taskTypeId which instances to be updated- Throws:
Exception
- if there is an error during information gathering
-