com.webmethods.caf.portalclient.task
Class PCTaskHelper

java.lang.Object
  extended by com.webmethods.caf.portalclient.task.PCTaskHelper

public class PCTaskHelper
extends Object

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
PCTaskHelper()
           
 
Method Summary
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 Task getTask(String user, String taskID, boolean includeTaskData)
          Fetches task by its ID
static String queueTask(String user, String taskTypeID, TaskInfo taskInfo, Hashtable 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 void updateTask(String user, String taskID, TaskInfo taskInfo, Hashtable taskData)
          Updates an existing task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PCTaskHelper

public PCTaskHelper()
Method Detail

queueTask

public static String queueTask(String user,
                               String taskTypeID,
                               TaskInfo taskInfo,
                               Hashtable taskData)
                        throws Exception
Queues 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 used
taskTypeID - (required) task type ID as defined in the Task Application
taskInfo - (optional) Additional generic information for the new task
taskData - (optional) Additionial business data for the new task
Returns:
newly created taskID if successfull
Throws:
Exception

updateTask

public static void updateTask(String user,
                              String taskID,
                              TaskInfo taskInfo,
                              Hashtable taskData)
                       throws Exception
Updates 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 used
taskID - (required) TaskID to be updated
taskInfo - (optional) Generic task information to be set on the task
taskData - (optional) Business data information to be set on the task
Throws:
Exception - if there is an error updating a task

deleteTask

public static void deleteTask(String user,
                              String taskID)
                       throws Exception
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 used
taskID - (required) TaskID to be deleted
Throws:
Exception - if there is an error deleting a task

getTask

public static Task getTask(String user,
                           String taskID,
                           boolean includeTaskData)
                    throws Exception
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 used
taskID - (required) TaskID to get
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
businessData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
includeTaskData - 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 used
taskSearchQuery - (optional) task search query. If null all tasks will be returned
businessData - 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 flow
result - the result string to return to the task flow, usually the URL that the flow should navigate to next
localOnly - only notify the local machine, do not sent notification events to other nodes in the MWS cluster
Throws:
Exception