public class PCTaskHelper extends Object
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(...)
methodsConstructor and Description |
---|
PCTaskHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
countAllTasksIndexed(String user,
TaskSearchQueryV2 taskSearchQuery,
boolean businessData)
Return the total result count for a task search against all tasks
|
static int |
countUserTasksIndexed(String user,
TaskSearchQueryV2 taskSearchQuery,
boolean businessData)
Return the total result count for a user inbox task search
|
static void |
deleteTask(String user,
String taskID)
Deletes a task
|
static void |
formFlowTaskNotify(String correlationID,
String result,
boolean localOnly)
Notify a task flow that a transition has occured
|
static RecalculationStatus |
getRecalculationStatus(String taskTypeId)
Retrieve Recalculation status of task type
|
static Task |
getTask(String user,
String taskID,
boolean includeTaskData)
Fetches task by its ID
|
static String |
queueTask(String user,
String taskTypeID,
TaskInfo taskInfo,
Hashtable<String,?> taskData)
Queues new task to the TaskEngine
|
static Task[] |
searchAllTasks(String user,
TaskSearchQuery taskSearchQuery,
boolean includeTaskData)
Searches all tasks
|
static Task[] |
searchAllTasksIndexed(String user,
TaskSearchQueryV2 taskSearchQuery,
boolean businessData)
Searches all tasks with paging
|
static TaskFields[] |
searchFieldsAllTasks(String user,
TaskSearchQuery taskSearchQuery,
boolean includeTaskData,
String[] fields)
Searches all tasks
|
static TaskFields[] |
searchFieldsUserTasks(String user,
TaskSearchQuery taskSearchQuery,
boolean includeTaskData,
String[] fields)
Searches user inbox tasks
|
static Task[] |
searchUserTasks(String user,
TaskSearchQuery taskSearchQuery,
boolean includeTaskData)
Searches user inbox tasks
|
static 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 type
|
static 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 type
|
static void |
stopVoteRecalculation(String user,
String taskTypeID)
Cancels the ongoing voting strategy recalculation for a given task type
|
static void |
updateTask(String user,
String taskID,
TaskInfo taskInfo,
Hashtable<String,?> taskData)
Updates an existing task
|
static void |
voteTask(String taskID,
String status,
String user)
Vote with a specific status for a certain task.
|
public static String queueTask(String user, String taskTypeID, TaskInfo taskInfo, Hashtable<String,?> taskData) throws Exception
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 taskException
public static void updateTask(String user, String taskID, TaskInfo taskInfo, Hashtable<String,?> taskData) throws Exception
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 taskException
- if there is an error updating a taskpublic static void deleteTask(String user, String taskID) throws Exception
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 deletedException
- if there is an error deleting a taskpublic static Task getTask(String user, String taskID, boolean includeTaskData) throws Exception
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 dataException
- if there is a problem getting taskpublic static Task[] searchAllTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static Task[] searchUserTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static TaskFields[] searchFieldsAllTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) throws Exception
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 dataException
- if there is a problem searching for taskspublic static TaskFields[] searchFieldsUserTasks(String user, TaskSearchQuery taskSearchQuery, boolean includeTaskData, String[] fields) throws Exception
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 dataException
- if there is a problem searching for taskspublic static Task[] searchAllTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static int countAllTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static Task[] searchUserTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static int countUserTasksIndexed(String user, TaskSearchQueryV2 taskSearchQuery, boolean businessData) throws Exception
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 dataException
- if there is a problem searching for taskspublic static void formFlowTaskNotify(String correlationID, String result, boolean localOnly) throws Exception
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 clusterException
public static String[] setInstancesStatus(String user, String taskTypeId, String status, Boolean logInFile, Integer batchSize) throws Exception
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 togetherException
- if there is an error updating all tasks statuspublic static void startVoteRecalculation(String user, String taskTypeID) throws Exception
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 recalculatedException
- if there is an error during recalculationpublic static void stopVoteRecalculation(String user, String taskTypeID) throws Exception
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 recalculatedException
public static void voteTask(String taskID, String status, String user)
taskID
- status
- user
- public static RecalculationStatus getRecalculationStatus(String taskTypeId) throws Exception
taskTypeId
- (required) taskTypeId which instances to be updatedException
- if there is an error during information gathering