Skip navigation links

Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1)
E10660-03


oracle.bpel.services.workflow.query
Interface ITaskQueryService


public interface ITaskQueryService
 This class provides a programmatic means for retrieving tasks, task details, etc
 
 A typical usage would be as follows:
  1. Use an authentication method to authenticate a user and obtain a context
  2. Use the context and a task list method to retrieve tasks that match some filter criterion
  3. Use the context and a task details method to drill down on a task in the list (retrieve task details
        and actions that can be performed on the task)
  4. Use task service, to perform operations on the task
  
 A sample code fragment that shows the usage in the above pattern in shown below:
 
   import java.util.ArrayList;
   import java.util.Date;
   import java.util.List;    
   import oracle.bpel.services.workflow.IWorkflowConstants;
   import oracle.bpel.services.workflow.client.IWorkflowServiceClient;
   import oracle.bpel.services.workflow.client.IWorkflowServiceClientConstants;
   import oracle.bpel.services.workflow.client.WorkflowServiceClientFactory;
   import oracle.bpel.services.workflow.query.ITaskQueryService;
   import oracle.bpel.services.workflow.repos.Ordering;
   import oracle.bpel.services.workflow.repos.Predicate;
   import oracle.bpel.services.workflow.repos.TableConstants;
   import oracle.bpel.services.workflow.task.ITaskService;
   import oracle.bpel.services.workflow.task.model.Task;
   import oracle.bpel.services.workflow.verification.IWorkflowContext;      
   
   //User whose task list needs to be queried
   String userid="jstein";
   // Password for the user
   String password = "welcome1";
   
   // You can use keyword to specify sql % around the keyword like: %keyword% on the following
   // attributes: task title, identification key, all textAttributes in task, task number (only
   // if the keyword is a number)
   
   String keyword = null;
   String nullParam = null;
 
   // Get workflow service client
   IWorkflowServiceClient wfSvcClient = WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.SOAP_CLIENT);
   // Get the workflow context
   IWorkflowContext wfCtx = wfSvcClient.getTaskQueryService().authenticate(userId, password, 
                                 oracle.tip.pc.services.identity.config.ISConfiguration.getDefaultRealmName(),
                                 null);
   // Admin can authenticate on behalf of another user
   //IWorkflowContext adminCtx = wfSvcClient.getTaskQueryService().authenticate(adminUserId, pwd, 
   //                              oracle.tip.pc.services.identity.config.ISConfiguration.getDefaultRealmName(),
   //                              userId);
   
   ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();      
   
   // Only for SOAP clients and it is mandatory for SOAP clients
   Predicate.enableXMLSerialization(true);
   
   // Build the predicate
   Predicate statePredicate = new Predicate(TableConstants.WFTASK_STATE_COLUMN,
                                Predicate.OP_NEQ,
                                IWorkflowConstants.TASK_STATE_ASSIGNED);
        statePredicate.addClause(Predicate.AND,
                         TableConstants.WFTASK_NUMBERATTRIBUTE1_COLUMN,
                         Predicate.OP_IS_NULL,
                         nullParam);
   Predicate datePredicate = new Predicate(TableConstants.WFTASK_ENDDATE_COLUMN,
                                Predicate.OP_ON,
                                new Date());
   Predicate predicate = new Predicate(statePredicate, Predicate.AND, datePredicate);
   
   // Create the ordering
   Ordering ordering = new Ordering(TableConstants.WFTASK_TITLE_COLUMN, true, true);        
     ordering.addClause(TableConstants.WFTASK_PRIORITY_COLUMN, true, true);
     
   // List of display columns
   // For those columns that are not specified here, the queried Task object will not hold any value.
   // For example: If TITLE is not specified, task.getTitle() will return null
   // For the list of most comonly used columns, check the table below
   // Note: TASKID is fetched by default. So there is no need to explicitly specity it.
   List queryColumns = new ArrayList();
     queryColumns.add("TASKNUMBER");     
     queryColumns.add("TITLE");
     queryColumns.add("PRIORITY");
     queryColumns.add("STATE");
     queryColumns.add("ENDDATE");
     queryColumns.add("NUMBERATTRIBUTE1");
     queryColumns.add("TEXTATTRIBUTE1");
     
   // List of optional info
   // Any optionalInfo specified can be fetched from the Task object
   // For example: if you have specified "CustomActions", you can retrieve
   // it using task.getSystemAttributes().getCustomActions();
   // "Actions" (All Actions) - task.getSystemAttributes().getSystemActions()
   // "GroupActions" (Only group Actions: Actions that can be permoded by the user as a member of a group)
   //                - task.getSystemAttributes().getSystemActions()
   // "ShortHistory" - task.getSystemAttributes().getShortHistory()
   List optionalInfo = new ArrayList();
     optionalInfo.add("Actions");
     //optionalInfo.add("GroupActions");
     //optionalInfo.add("CustomActions");
     //optionalInfo.add("ShortHistory");
     // The following is reserved for future use. 
     // If you need them, please use getTaskDetailsById (or) getTaskDetailsByNumber,
     // which will fetch all information related to a task, which includes these
        //optionalInfo.add("Attachments");
        //optionalInfo.add("Comments");
        //optionalInfo.add("Payload");

   List tasksList = querySvc.queryTasks(wfCtx,
                               queryColumns,
                               optionalInfo,
                               ITaskQueryService.ASSIGNMENT_FILTER_MY_AND_GROUP,
                               keyword,
                               predicate, 
                               ordering, 
                               0,0); // No Paging
                               
   // How to use paging:
   // 1. If you need to dynamically calculate paging size (or) to display/find 
   //    out the number of pages, the user has to scroll (Like page X of Y)
   //      Call queryTasks to find out the number of tasks it returns. Using this 
   //      calculate your paging size (The number of taks you want in a page)
   //      Call queryTasks successively varing the startRow and endRow params.  
   //      For example: If the total number of tasks is 30 and your want a paging size
   //      of 10, you can call with (startRow, endRow): (1, 10) (11, 20) (21, 30) 
   // 2. If you have fixed paging size, just keep calling queryTasks successively with 
   //      the paging size (If your paging size is 10, you can call with (startRow, endRow): 
   //      (1, 10) (11, 20) (21, 30) (31, 40).....  until the number of tasks returned is 
   //      less than your paging size (or) there are no more tasks returned     

   if (tasksList != null) { // There are tasks 
     System.out.println("Total number of tasks: " + tasksList.size()); 
     System.out.println("Tasks List: ");
     Task task = null; 
     for (int i = 0; i < tasksList.size(); i++) { 
       task = (Task) tasksList.get(i);          
       System.out.println("Task Number: " + task.getSystemAttributes().getTaskNumber());
       System.out.println("Task Id: " + task.getSystemAttributes().getTaskId());
       System.out.println("Title: " + task.getTitle());
       System.out.println("Priority: " + task.getPriority());
       System.out.println("State: " + task.getSystemAttributes().getState());
       System.out.println();
       // Retrive any Optional Info specified
       // Use task service, to perform operations on the task
     }
   }
   
 Beyond authentication, all methods require the worklist context as the first argument. The worklist context 
 helps the worklist service determine the user requesting the action, whether the user has permission to 
 perform the requested action on the task and so forth. The context also contains information about the 
 user's locale and timezone information.
 

Most commonly used columns
Column objects are defined in oracle.bpel.services.workflow.repos.TableConstants, and they can also be obtained by passing the column name to the static method getColumn() on oracle.bpel.services.workflow.repos.Column.
A list task attributes and column names can be obtained by calling the method ITaskMetadataService.getTaskAttributes(oracle.bpel.services.workflow.verification.IWorkflowContext) or ITaskMetadataService.getTaskAttributesForTaskDefinition(oracle.bpel.services.workflow.verification.IWorkflowContext, java.lang.String).

Column Description Column Object How to retrieve
ACQUIREDBY Acquired By WFTASK_ACQUIREDBY_COLUMN task.getSystemAttributes().getAcquiredBy()
ASSIGNEES Assignees WFTASK_ASSIGNEES_COLUMN task.getSystemAttributes().getAssignees()
REVIEWERS Reviewers WFTASK_REVIEWERS_COLUMN task.getSystemAttributes().getReviewers()
ASSIGNEEGROUPS Assignee Groups WFTASK_ASSIGNEEGROUPS_COLUMN task.getSystemAttributes().getAssigneeGroups()
ASSIGNEEUSERS Assignee Users WFTASK_ASSIGNEEUSERS_COLUMN task.getSystemAttributes().getAssigneeUsers()
CREATOR Creator WFTASK_CREATOR_COLUMN task.getCreator()
DIGITALSIGNATUREREQUIRED Digital Signature Required WFTASK_DIGITALSIGNATUREREQUIRED_COLUMN task.getSystemAttributes().isDigitalSignatureRequired()
EXPIRATIONDATE Expiration Date WFTASK_EXPIRATIONDATE_COLUMN task.getSystemAttributes().getExpirationDate()
IDENTITYCONTEXT Identity Context WFTASK_IDENTITYCONTEXT_COLUMN task.getIdentityContext()
OWNERUSER Owner User WFTASK_OWNERUSER_COLUMN task.getOwnerUser()
OWNERGROUP Owner Group WFTASK_OWNERGROUP_COLUMN task.getOwnerGroup()
PASSWORDREQUIREDONUPDATE Password Required On Update WFTASK_PASSWORDREQUIREDONUPDATE_COLUMN task.getSystemAttributes().isPasswordRequiredOnUpdate()
PRIORITY Priority WFTASK_PRIORITY_COLUMN task.getPriority()
SECURENOTIFICATIONS Secure Notifications WFTASK_SECURENOTIFICATIONS_COLUMN task.getSystemAttributes().isSecureNotifications()
ASSIGNEDDATE Assigned Date WFTASK_ASSIGNEDDATE_COLUMN task.getSystemAttributes().getAssignedDate()
CREATEDDATE Created Date WFTASK_CREATEDDATE_COLUMN task.getSystemAttributes().getCreatedDate()
ENDDATE End Date WFTASK_ENDDATE_COLUMN task.getSystemAttributes().getEndDate()
FROMUSER From User WFTASK_FROMUSER_COLUMN task.getSystemAttributes().getFromUser()
HASSUBTASK Has Subtask WFTASK_HASSUBTASK_COLUMN task.getSystemAttributes().isHasSubTasks()
ISGROUP Is Group WFTASK_ISGROUP_COLUMN task.getSystemAttributes().isIsGroup()
ORIGINALASSIGNEEUSER Original Assignee User WFTASK_ORIGINALASSIGNEEUSER_COLUMN task.getSystemAttributes().()
OUTCOME Outcome WFTASK_OUTCOME_COLUMN task.getSystemAttributes().getOriginalAssigneeUser()
STATE State WFTASK_STATE_COLUMN task.getSystemAttributes().getState()
TASKID Task Id WFTASK_TASKID_COLUMN task.getSystemAttributes().getTaskId()
TASKNUMBER Task Number WFTASK_TASKNUMBER_COLUMN task.getSystemAttributes().getTaskNumber()
UPDATEDBY Updated By WFTASK_UPDATEDBY_COLUMN task.getSystemAttributes().getUpdatedBy()
UPDATEDDATE Updated Date WFTASK_UPDATEDDATE_COLUMN task.getSystemAttributes().getUpdatedDate()
TEXTATTRIBUTE1 to TEXTATTRIBUTE10 Textattribute1 to Textattribute10 WFTASK_TEXTATTRIBUTE1_COLUMN to WFTASK_TEXTATTRIBUTE10_COLUMN task.getSystemMessageAttributes().getTextAttribute1() to task.getSystemMessageAttributes().getTextAttribute10()
FORMATTRIBUTE1 to FORMATTRIBUTE5 FormAttribute1 to FormAttribute5 WFTASK_FORMATTRIBUTE1_COLUMN to WFTASK_FORMATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getFormAttribute1() to task.getSystemMessageAttributes().getFormAttribute5()
URLATTRIBUTE1 to URLATTRIBUTE5 UrlAttribute1 to UrlAttribute5 WFTASK_URLATTRIBUTE1_COLUMN to WFTASK_URLATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getUrlAttribute1() to task.getSystemMessageAttributes().getUrlAttribute5()
DATEATTRIBUTE1 to DATEATTRIBUTE5 DateAttribute1 to DateAttribute5 WFTASK_DATEATTRIBUTE1_COLUMN to WFTASK_DATEATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getDateAttribute1() to task.getSystemMessageAttributes().getDateAttribute5()
NUMBERATTRIBUTE1 to NUMBERATTRIBUTE5 NumberAttribute1 to NumberAttribute5 WFTASK_NUMBERATTRIBUTE1_COLUMN to WFTASK_NUMBERATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getNumberAttribute1() to task.getSystemMessageAttributes().getNumberAttribute5()
TITLE Title WFTASK_TITLE_COLUMN task.getTitle()
IDENTIFICATIONKEY Identification key WFTASK_IDENTIFICATIONKEY_COLUMN task.getIdentificationKey()
TASKDEFINITIONID Task Definition Id WFTASK_TASKDEFINITIONID_COLUMN task.getTaskDefinitionId()
TASKDEFINITIONNAME Task Definition Name WFTASK_TASKDEFINITIONNAME_COLUMN task.getSystemAttributes().getTaskDefinitionName()
PROTECTEDTEXTATTRIBUTE1 to PROTECTEDTEXTATTRIBUTE10 ProtectedTextAttribute1 to ProtectedTextAttribute10 WFTASK_PROTECTEDTEXTATTRIBUTE1_COLUMN to WFTASK_PROTECTEDTEXTATTRIBUTE10_COLUMN task.getSystemMessageAttributes().getProtectedTextAttribute1() to task.getSystemMessageAttributes().getProtectedTextAttribute10()
PROTECTEDFORMATTRIBUTE1 to PROTECTEDFORMATTRIBUTE5 ProtectedFormAttribute1 to ProtectedFormAttribute5 WFTASK_PROTECTEDFORMATTRIBUTE1_COLUMN to WFTASK_PROTECTEDFORMATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getFormAttribute1() to task.getSystemMessageAttributes().getFormAttribute5()
PROTECTEDURLATTRIBUTE1 to PROTECTEDURLATTRIBUTE5 ProtectedURLAttribute1 to ProtectedURLAttribute5 WFTASK_PROTECTEDURLATTRIBUTE1_COLUMN to WFTASK_PROTECTEDURLATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getProtectedURLAttribute1() to task.getSystemMessageAttributes().getProtectedURLAttribute5()
PROTECTEDDATEATTRIBUTE1 to PROTECTEDDATEATTRIBUTE5 ProtectedDateAttribute1 to ProtectedDateAttribute5 WFTASK_PROTECTEDDATEATTRIBUTE1_COLUMN to WFTASK_PROTECTEDDATEATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getProtectedDateAttribute1() to task.getSystemMessageAttributes().getProtectedDateAttribute5()
PROTECTEDNUMBERATTRIBUTE1 to PROTECTEDNUMBERATTRIBUTE5 ProtectedNumberAttribute1 to ProtectedNumberAttribute5 WFTASK_PROTECTEDNUMBERATTRIBUTE1_COLUMN to WFTASK_PROTECTEDNUMBERATTRIBUTE5_COLUMN task.getSystemMessageAttributes().getProtectedNumberAttribute1() to task.getSystemMessageAttributes().getProtectedNumberAttribute5()
APPLICATIONCONTEXT Application Context WFTASK_APPLICATIONCONTEXT_COLUMN task.getApplicationContext()
CATEGORY Category WFTASK_CATEGORY_COLUMN task.getCategory()
DUEDATE Due Date WFTASK_DUEDATE_COLUMN task.getDueDate()
ISPUBLIC Is Public WFTASK_ISPUBLIC_COLUMN task.isIsPublic()
PARTICIPANTNAME Participant Name WFTASK_PARTICIPANTNAME_COLUMN task.getSystemAttributes().getParticipantName()
PERCENTAGECOMPLETE Percentage Complete WFTASK_PERCENTAGECOMPLETE_COLUMN task.getPercentageComplete()
STARTDATE Start Date WFTASK_STARTDATE_COLUMN task.getStartDate()
TASKDISPLAYURL Task Display Url WFTASK_TASKDISPLAYURL_COLUMN task.getTaskDisplayUrl()

Nested Class Summary
static class ITaskQueryService.AssignmentFilter
          Enumeration for specifying the assignment filter to be used in Task Queries
static class ITaskQueryService.OptionalInfo
          Enumeration for specifying additional information to be retrieved whilst executing Task Queries
static class ITaskQueryService.TaskActionsType
          Enumeration for task actions type
static class ITaskQueryService.TaskSequenceBuilderContext
           
static class ITaskQueryService.TaskSequenceType
          Enumeration for specifying the type of task sequence to be retrieved whilst executing Task Sequence Queries

 

Field Summary
static java.lang.String ASSIGNMENT_FILTER_ADMIN
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_ALL
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_CREATOR
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_GROUP
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_MY
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_MY_AND_GROUP
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_OWNER
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_PREVIOUS
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_REPORTEES
          Deprecated.  
static java.lang.String ASSIGNMENT_FILTER_REVIEWER
          Deprecated.  
static java.lang.String TASK_ACTIONS_TYPE_ALL_ACTIONS
           
static java.lang.String TASK_ACTIONS_TYPE_CUSTOM_ACTIONS
           
static java.lang.String TASK_ACTIONS_TYPE_GROUP_ACTIONS
           

 

Method Summary
 IWorkflowContext authenticate(java.lang.String user, char[] password, java.lang.String identityContext)
          authenticate is used for authenticating a user with the identity authentication service based on the specified user/password and returns a workflow context
 IWorkflowContext authenticate(java.lang.String user, java.lang.String password, java.lang.String identityContext, java.lang.String onBehalfOfUser)
          Deprecated. since 11. Use authenticate(String, char[], String) or authenticateOnBehalfOf(IWorkflowContext, String)
 IWorkflowContext authenticateOnBehalfOf(IWorkflowContext adminWorkflowContext, java.lang.String onBehalfOfUser)
          Admin can authenticate on behalf of another user, and get the workflow context for the user specified in onBehalfOfUser
 int countTasks(IWorkflowContext ctx, ITaskQueryService.AssignmentFilter assignmentFilter, java.lang.String keywords, Predicate predicate)
          Counts the number of tasks that match the specified query criteria.
 int countViewTasks(IWorkflowContext ctx, java.lang.String viewId, Predicate extraPredicate)
          Counts the number of tasks that match the query criteria of the specified view.
 IWorkflowContext createContext(HttpServletRequest request)
          createContext is used for creating a context from a pre-authenticated environment such as a SSO based application.
 IWorkflowContext createContextFromRequestObject(java.lang.Object request)
          createContextFromRequestObject is used for creating a context from a pre-authenticated environment such as a SSO based application.
 void destroyWorkflowContext(IWorkflowContext ctx)
          destroyWorkflowContext is used for cleaning up a workflow context that is no longer needed.
 boolean doesTaskExist(IWorkflowContext ctx, ITaskQueryService.AssignmentFilter assignmentFilter, java.lang.String keywords, Predicate predicate)
          Checks to see if any tasks exist that match the specified query criteria.
 boolean doesViewTaskExist(IWorkflowContext ctx, java.lang.String viewId, Predicate extraPredicate)
          Checks to see if any tasks exist match the query criteria of the specified view.
 oracle.bpel.services.workflow.task.IRestrictedAssignees getPermittedAssignees(IWorkflowContext ctx, Task task, java.lang.String operation)
          getPermittedAssignees gets a list of users to whom the current task can be reassigned to by the current user.
 Task getTaskDetailsById(IWorkflowContext ctx, java.lang.String taskId)
          getTaskDetailsById gets the details of a task whose id is taskId
 Task getTaskDetailsByNumber(IWorkflowContext ctx, int taskNumber)
          getTaskDetailsByNumber gets the details of a task whose number is taskNumber
 java.util.List getTaskHistory(IWorkflowContext ctx, java.lang.String taskId)
          Deprecated. use @link{#getTaskHistory(IWorkflowContext, String, List)} instead.
 java.util.List<Task> getTaskHistory(IWorkflowContext ctx, java.lang.String taskId, java.util.List<java.lang.String> displayColumns)
          getTaskHistory returns a list of historical task versions for the specified taskId.
 TaskSequence getTaskSequence(IWorkflowContext ctx, java.lang.String taskId, java.util.List<java.lang.String> taskDisplayColumns, java.util.List<ITaskQueryService.TaskSequenceType> taskSequenceType, java.util.List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext, boolean fetchTaskSequenceForRootTask)
           
 TaskSequence getTaskSequence(IWorkflowContext ctx, Task task, java.util.List<java.lang.String> taskDisplayColumns, java.util.List<ITaskQueryService.TaskSequenceType> taskSequenceType, java.util.List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext, boolean fetchTaskSequenceForRootTask)
           getTaskSequence gets the task sequence tree of a task whose id is taskId, for those type of sequence specified in sequenceTypes There are 4 types of objects in the returned tree.
 Task getTaskVersionDetails(IWorkflowContext ctx, java.lang.String taskId, int versionNumber)
          getTaskVersionDetails gets the task version details of a task whose id is taskId for the version denoted by versionNumber
 IWorkflowContext getWorkflowContext(java.lang.String ctxToken)
          getWorkflowContext is used for retrieving a workflow context based on the given token.
 IWorkflowContext getWorkflowContextForAuthenticatedUser()
          Gets WorkflowContext for already authenticated user and whose identity is propagated to server The method returns valid context only if user identity is propagated to the service and context is still valid, else the method throws WorkflowException exception
 java.util.List<TaskCountType> queryAggregatedTasks(IWorkflowContext ctx, Column groupByColumn, ITaskQueryService.AssignmentFilter assignmentFilter, java.lang.String keywords, Predicate predicate, boolean orderByCount, boolean ascendingOrder)
          Executes the specified query, and aggregates a count of the tasks returned by the query, grouped by the specified column.
 java.util.List<oracle.bpel.services.workflow.task.error.model.TaskError> queryTaskErrors(IWorkflowContext ctx, Predicate predicate, Ordering ordering, int startRow, int endRow)
          queryTaskErrors returns a list of TaskError objects matching the specified predicate
 java.util.List<Task> queryTasks(IWorkflowContext ctx, java.util.List displayColumns, java.util.List<ITaskQueryService.OptionalInfo> optionalInformation, ITaskQueryService.AssignmentFilter assignmentFilter, java.lang.String keywords, Predicate predicate, Ordering ordering, int startRow, int endRow)
          queryTasks returns a list of tasks that match the predicate and ordering criterion.
 java.util.List queryTasks(IWorkflowContext ctx, java.util.List displayColumns, java.util.List optionalInformation, java.lang.String assignmentFilter, java.lang.String keywords, Predicate predicate, Ordering ordering, int startRow, int endRow)
          Deprecated.  
 java.util.List<Task> queryTasks(IWorkflowContext ctx, java.lang.String presentationId, ITaskQueryService.AssignmentFilter assignmentFilter, java.lang.String keywords, Predicate predicate, int startRow, int endRow)
          queryTasks returns a list of tasks that match the predicate.
 java.util.List<TaskCountType> queryViewAggregatedTasks(IWorkflowContext ctx, java.lang.String viewId, Predicate extraPredicate, Column defaultGroupByColumn, boolean defaultOrderByCount, boolean defaultAscendingOrder)
          Executes the query as defined in the specified view, and agregates the selected tasks according to the chart property defined in the view.
 java.util.List queryViewTasks(IWorkflowContext ctx, java.lang.String viewId, Predicate extraPredicate, Ordering defaultOrdering, int startRow, int endRow)
          queryViewTasks returns a list of tasks that match the criterion specified in the view such as columns, optional info, assignmentFilter, keywords, predicate, ordering.

 

Field Detail

ASSIGNMENT_FILTER_MY

static final java.lang.String ASSIGNMENT_FILTER_MY
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_GROUP

static final java.lang.String ASSIGNMENT_FILTER_GROUP
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_MY_AND_GROUP

static final java.lang.String ASSIGNMENT_FILTER_MY_AND_GROUP
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_REPORTEES

static final java.lang.String ASSIGNMENT_FILTER_REPORTEES
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_CREATOR

static final java.lang.String ASSIGNMENT_FILTER_CREATOR
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_OWNER

static final java.lang.String ASSIGNMENT_FILTER_OWNER
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_REVIEWER

static final java.lang.String ASSIGNMENT_FILTER_REVIEWER
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_PREVIOUS

static final java.lang.String ASSIGNMENT_FILTER_PREVIOUS
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_ALL

static final java.lang.String ASSIGNMENT_FILTER_ALL
Deprecated. 
See Also:
Constant Field Values

ASSIGNMENT_FILTER_ADMIN

static final java.lang.String ASSIGNMENT_FILTER_ADMIN
Deprecated. 
See Also:
Constant Field Values

TASK_ACTIONS_TYPE_ALL_ACTIONS

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

TASK_ACTIONS_TYPE_GROUP_ACTIONS

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

TASK_ACTIONS_TYPE_CUSTOM_ACTIONS

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

Method Detail

createContext

IWorkflowContext createContext(HttpServletRequest request)
                               throws WorkflowException
createContext is used for creating a context from a pre-authenticated environment such as a SSO based application. The user information is extracted from the authenticated environment and a workflow context is returned for that user (Assuming that HttpServletRequest is from an authenticated user, HttpServletRequest.getRemoteUser() should return the name of the user)
Parameters:
request - The pre-authenticated environment (request) to create the context for
Returns:
IWorkflowContext the workflow context
Throws:
WorkflowException - any exception thrown during authentication

createContextFromRequestObject

IWorkflowContext createContextFromRequestObject(java.lang.Object request)
                                                throws WorkflowException
createContextFromRequestObject is used for creating a context from a pre-authenticated environment such as a SSO based application. The user information is extracted from the authenticated environment and a workflow context is returned for that user (Object request (Either instance of PortletRequest or HttpServletRequest) is from an authenticated user)
Parameters:
request - The pre-authenticated HttpServletRequest/PortletRequest to create the workflow context for
Returns:
IWorkflowContext the workflow context
Throws:
WorkflowException - any exception thrown during authentication

authenticate

IWorkflowContext authenticate(java.lang.String user,
                              java.lang.String password,
                              java.lang.String identityContext,
                              java.lang.String onBehalfOfUser)
                              throws WorkflowException
Deprecated. since 11. Use authenticate(String, char[], String) or authenticateOnBehalfOf(IWorkflowContext, String)
authenticate is used for authenticating a user with the identity authentication service based on the specified user/password and returns a workflow context
Parameters:
user - the name of the user who needs to be authenticated
password - the password of the user who needs to be authenticated
identityContext - the identityContext (usually realm) of the user
onBehalfOfUser - The user on behalf of whom the context should be created (Admin can authenticate on behalf of another user, and get the workflow context for the user specified in onBehalfOfUser)
Returns:
IWorkflowContext the workflow context
Throws:
WorkflowException - any exception thrown during authentication

authenticate

IWorkflowContext authenticate(java.lang.String user,
                              char[] password,
                              java.lang.String identityContext)
                              throws WorkflowException
authenticate is used for authenticating a user with the identity authentication service based on the specified user/password and returns a workflow context
Parameters:
user - the name of the user who needs to be authenticated
password - the password of the user who needs to be authenticated
identityContext - the identityContext (usually realm) of the user
Returns:
IWorkflowContext the workflow context
Throws:
WorkflowException - any exception thrown during authentication

authenticateOnBehalfOf

IWorkflowContext authenticateOnBehalfOf(IWorkflowContext adminWorkflowContext,
                                        java.lang.String onBehalfOfUser)
                                        throws WorkflowException
Admin can authenticate on behalf of another user, and get the workflow context for the user specified in onBehalfOfUser
Parameters:
IWorkflowContext - the workflow context of the admin
onBehalfOfUser - The user on behalf of whom the context should be created
Returns:
IWorkflowContext the workflow context for the user specified in onBehalfOfUser
Throws:
WorkflowException - any exception thrown during authentication

getWorkflowContextForAuthenticatedUser

IWorkflowContext getWorkflowContextForAuthenticatedUser()
                                                        throws WorkflowException
Gets WorkflowContext for already authenticated user and whose identity is propagated to server The method returns valid context only if user identity is propagated to the service and context is still valid, else the method throws WorkflowException exception
Returns:
IWorkflowContext object.
Throws:
WorkflowException - any exception thrown during authentication

getWorkflowContext

IWorkflowContext getWorkflowContext(java.lang.String ctxToken)
                                    throws WorkflowException
getWorkflowContext is used for retrieving a workflow context based on the given token.
Parameters:
ctxToken - the token to be used for retrieving the context
Returns:
IWorkflowContext the workflow context
Throws:
WorkflowException - any exception thrown during retrieval

destroyWorkflowContext

void destroyWorkflowContext(IWorkflowContext ctx)
                            throws WorkflowException
destroyWorkflowContext is used for cleaning up a workflow context that is no longer needed. This will free up the memory used for storing the workflow context. This is used typically when a user logs out..
Parameters:
ctx - the workflow context
Throws:
WorkflowException - any exception thrown during authentication

queryTasks

java.util.List queryTasks(IWorkflowContext ctx,
                          java.util.List displayColumns,
                          java.util.List optionalInformation,
                          java.lang.String assignmentFilter,
                          java.lang.String keywords,
                          Predicate predicate,
                          Ordering ordering,
                          int startRow,
                          int endRow)
                          throws WorkflowException
Deprecated. 
queryTasks returns a list of tasks (Task Objects). The assignmentFilter is used to filter the tasks based on the task assignment. The tasks returned can be restricted by specifying valid values (>0) for the startRow and endRow to facilitate database level paging. If these values are set to 0 then all qualifying tasks are returned.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
assignmentFilter - the filter for task assignment
 For all possible values, check the assignment filters defined in this interface, 
 like ASSIGNMENT_FILTER_<Filter Name>
 
displayColumns - a list containing names of columns to be retrieved
 For those columns that are not specified here, the queried Task object will not hold any value.
 For example: If TITLE is not specified, task.getTitle() will return null
 For the complete list of columns that can be specified here, check the table shown above
 Note: TASKID is fetched by default. So there is no need to explicitly specity it.

 If displayColumns is null or has no elements, then the following columns will be returned
 by default:

  
Column
WFTASK_TASKID_COLUMN
WFTASK_TASKGROUPID_COLUMN
WFTASK_TASKNUMBER_COLUMN
WFTASK_TASKDEFINITIONID_COLUMN
WFTASK_TASKGROUPINSTANCEID_COLUMN
WFTASK_SUBTASKGROUPINSTANCEID_COLUMN
WFTASK_ACQUIREDBY_COLUMN
WFTASK_ASSIGNEES_COLUMN
WFTASK_REVIEWERS_COLUMN
WFTASK_CREATOR_COLUMN
WFTASK_OWNERUSER_COLUMN
WFTASK_OWNERGROUP_COLUMN
WFTASK_DIGITALSIGNATUREREQUIRED_COLUMN
WFTASK_EXPIRATIONDATE_COLUMN
WFTASK_PRIORITY_COLUMN
WFTASK_ASSIGNEDDATE_COLUMN
WFTASK_CREATEDDATE_COLUMN
WFTASK_ENDDATE_COLUMN
WFTASK_STATE_COLUMN
WFTASK_UPDATEDBY_COLUMN
WFTASK_UPDATEDDATE_COLUMN
WFTASK_WORKFLOWPATTERN_COLUMN
WFTASK_TITLE_COLUMN
WFTASK_CATEGORY_COLUMN
WFTASK_DUEDATE_COLUMN
WFTASK_PERCENTAGECOMPLETE_COLUMN
WFTASK_STARTDATE_COLUMN
WFTASK_TASKDISPLAYURL_COLUMN


 
optionalInformation - a list specifying optional information to be retrieved
 Possible Values:
 1) Actions (All actions that can be performed on the task)
 2) GroupActions (Only group Actions: Actions that can be performed on a group of tasks)
 3) CustomActions (Custom actions applicable to the specific task type)
 4) ShortHistory (A concise history of changes made to the task)
 All optionalInfo specified can be fetched from the Task object
  For example: if you have specified "CustomActions", you can retrieve
  it using task.getSystemAttributes().getCustomActions();
  Actions" (All Actions) - task.getSystemAttributes().getSystemActions()
  "GroupActions" (Only group Actions)- task.getSystemAttributes().getSystemActions()
  "ShortHistory" - task.getSystemAttributes().getShortHistory()
 The following is reserved for future use.
 If you need them, please use getTaskDetailsById (or) getTaskDetailsByNumber,
 which will fetch all information related to a task, which includes these
 Attachments
 Comments
 Payload
 
keywords - an optional search string
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %$lt;keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the predicate for filtering the tasks
ordering - the ordering criteria for sorting the tasks
startRow - the rownum of the starting row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
endRow - the rownum of the ending row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while querying tasks

queryTasks

java.util.List<Task> queryTasks(IWorkflowContext ctx,
                                java.util.List displayColumns,
                                java.util.List<ITaskQueryService.OptionalInfo> optionalInformation,
                                ITaskQueryService.AssignmentFilter assignmentFilter,
                                java.lang.String keywords,
                                Predicate predicate,
                                Ordering ordering,
                                int startRow,
                                int endRow)
                                throws WorkflowException
queryTasks returns a list of tasks that match the predicate and ordering criterion. The assignmentFilter is used to filter the tasks based on the task assignment. The tasks returned can be restricted by specifying valid values (>0) for the startRow and endRow to facilitate database level paging. If these values are set to 0 then all qualifying tasks are returned.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
assignmentFilter - the filter for task assignment. Mandatory paramter.
 For all possible values, check the list of assignment filters defined 
 in this interface, in the enum AssignmentFilter
 
displayColumns - a list containing names of columns to be retrieved
 For those columns that are not specified here, the queried Task object will not hold any value.
 For example: If TITLE is not specified, task.getTitle() will return null
 For the complete list of columns that can be specified here, check the table shown above
 Note: TASKNUMBER and TASKID are fetched by default. So there is no need to explicitly specity it.

 If displayColumns is null or has no elements, then the following columns will be returned
 by default:

  
Column
WFTASK_TASKID_COLUMN
WFTASK_TASKGROUPID_COLUMN
WFTASK_TASKNUMBER_COLUMN
WFTASK_TASKDEFINITIONID_COLUMN
WFTASK_TASKGROUPINSTANCEID_COLUMN
WFTASK_SUBTASKGROUPINSTANCEID_COLUMN
WFTASK_ACQUIREDBY_COLUMN
WFTASK_ASSIGNEES_COLUMN
WFTASK_REVIEWERS_COLUMN
WFTASK_CREATOR_COLUMN
WFTASK_OWNERUSER_COLUMN
WFTASK_OWNERGROUP_COLUMN
WFTASK_DIGITALSIGNATUREREQUIRED_COLUMN
WFTASK_EXPIRATIONDATE_COLUMN
WFTASK_PRIORITY_COLUMN
WFTASK_ASSIGNEDDATE_COLUMN
WFTASK_CREATEDDATE_COLUMN
WFTASK_ENDDATE_COLUMN
WFTASK_STATE_COLUMN
WFTASK_UPDATEDBY_COLUMN
WFTASK_UPDATEDDATE_COLUMN
WFTASK_WORKFLOWPATTERN_COLUMN
WFTASK_TITLE_COLUMN
WFTASK_CATEGORY_COLUMN
WFTASK_DUEDATE_COLUMN
WFTASK_PERCENTAGECOMPLETE_COLUMN
WFTASK_STARTDATE_COLUMN
WFTASK_TASKDISPLAYURL_COLUMN


 
optionalInformation - a list specifying optional information to be retrieved
 Possible Values: (Refer to the enum OptionalInfo, defined in this interface)
 1) ALL_ACTIONS (All actions that can be performed on the task)
 2) GROUP_ACTIONS (Only group Actions: Actions that can be performed on a group of tasks)
 3) CUSTOM_ACTIONS (Custom actions applicable to the specific task type)
 4) SHORT_HISTORY (A concise history of changes made to the task)
 5) DISPLAY_INFO (Information relating to the URI for the task details display page)
 All optionalInfo specified can be fetched from the Task object
  For example: if you have specified "CUSTOM_ACTIONS", you can retrieve
  it using task.getSystemAttributes().getCustomActions();
  "ALL_ACTIONS" (All Actions) - task.getSystemAttributes().getSystemActions()
  "GROUP_ACTIONS" (Only group Actions)- task.getSystemAttributes().getSystemActions()
  "SHORT_HISTORY" - task.getSystemAttributes().getShortHistory()
  "DISPLAY_INFO" - task.getSystemAttributes().getDisplayInfo()
  "ATTACHMENTS"  - task.getAttachment()
  "COMMENTS"     - task.getAddedComment() 
  "PAYLOAD"      - task.getPayloadAsElement()
 
If optionalInformation is null, then no addtional information will be retrieved.
keywords - an optional search string.
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %<keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the predicate for filtering the tasks. Optional parameter - may be null.
ordering - the ordering criteria for sorting the tasks. Optional parameter - if no value is set, the tasks wil be ordered by task number.
startRow - the rownum of the starting row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
endRow - the rownum of the ending row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while querying tasks

queryTasks

java.util.List<Task> queryTasks(IWorkflowContext ctx,
                                java.lang.String presentationId,
                                ITaskQueryService.AssignmentFilter assignmentFilter,
                                java.lang.String keywords,
                                Predicate predicate,
                                int startRow,
                                int endRow)
                                throws WorkflowException
queryTasks returns a list of tasks that match the predicate. The columns queryied and the order of the returned tasks are determined by the specified Presentation.

The user must have access to the specified presentation (must be the presentation owner, a grantee, or have andmin privileges).

The assignmentFilter is used to filter the tasks based on the task assignment. The tasks returned can be restricted by specifying valid values (>0) for the startRow and endRow to facilitate database level paging. If these values are set to 0 then all qualifying tasks are returned.

Parameters:
ctx - the workflow context (can contain valid token or credentials)
presentationId - the id of the Presentation to use for this query. The columns and optional info specified in the presetation will be queried, and the query results will be ordered according to the ordering clauses in the Presentation.
assignmentFilter - the filter for task assignment. Mandatory paramter.
 For all possible values, check the list of assignment filters defined 
 in this interface, in the enum AssignmentFilter
 
keywords - an optional search string.
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %<keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the predicate for filtering the tasks. Optional parameter - may be null.
startRow - the rownum of the starting row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
endRow - the rownum of the ending row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while querying tasks

queryAggregatedTasks

java.util.List<TaskCountType> queryAggregatedTasks(IWorkflowContext ctx,
                                                   Column groupByColumn,
                                                   ITaskQueryService.AssignmentFilter assignmentFilter,
                                                   java.lang.String keywords,
                                                   Predicate predicate,
                                                   boolean orderByCount,
                                                   boolean ascendingOrder)
                                                   throws WorkflowException
Executes the specified query, and aggregates a count of the tasks returned by the query, grouped by the specified column. Typically used by clients to query data for displaying a bar chart summary of task data - for example, a chart showing the distribution of tasks by task state. Clients can specify query parameters, the column the task counts should be grouped by, and how the results should be ordered.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
groupByColumn - the Column the task counts should be grouped by.
assignmentFilter - the filter for task assignment
 For all possible values, check the list of assignment filters defined 
 in this interface, in the enum AssignmentFilter. Mandatory parameter.
 
keywords - an optional search string.
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %<keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the Predicate for filtering the tasks. Optional parameter - may be null.
orderByCount - if true, results will be ordered by the counts, if false, results will be ordered by the values of the groupBy column.
ascendingOrder - if true, results will be in ascending order, otherwise results will be in descending order.
Returns:
a List of TaskCountType objects. Each TaskCountType object has a value field containing a value from the groupBy column and a count field containing the number of tasks that have that value.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

countTasks

int countTasks(IWorkflowContext ctx,
               ITaskQueryService.AssignmentFilter assignmentFilter,
               java.lang.String keywords,
               Predicate predicate)
               throws WorkflowException
Counts the number of tasks that match the specified query criteria. Using this method is generally more performant than using queryTasks and getting the size of the returned List.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
assignmentFilter - the filter for task assignment
 For all possible values, check the list of assignment filters defined 
 in this interface, in the enum AssignmentFilter. Mandatory parameter.
 
keywords - an optional search string.
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %<keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the Predicate for filtering the tasks. Optional parameter - may be null.
Returns:
int number of tasks that match the specified query criteria. If no tasks are found, returns 0.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

doesTaskExist

boolean doesTaskExist(IWorkflowContext ctx,
                      ITaskQueryService.AssignmentFilter assignmentFilter,
                      java.lang.String keywords,
                      Predicate predicate)
                      throws WorkflowException
Checks to see if any tasks exist that match the specified query criteria. Using this method is generatlly more performant than using queryTasks or countTasks, especially where a large number of tasks match the query criteria.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
assignmentFilter - the filter for task assignment
 For all possible values, check the list of assignment filters defined 
 in this interface, in the enum AssignmentFilter. Mandatory parameter.
 
keywords - an optional search string.
 If this keyword is null, it is omitted from all query. If not null, predicates 
 will be added to the query predicate to perform SQL 'like' operation (this method 
 will add the sql % around the keyword: %<keyword>%) on the following task 
 attributes: task title, identification key, all textAttributes in task, task 
 number (only if the keyword is a number)
 
predicate - the Predicate for filtering the tasks. Optional parameter - may be null.
Returns:
boolean true if any tasks match the specified query criteria, otherwise false.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

queryViewTasks

java.util.List queryViewTasks(IWorkflowContext ctx,
                              java.lang.String viewId,
                              Predicate extraPredicate,
                              Ordering defaultOrdering,
                              int startRow,
                              int endRow)
                              throws WorkflowException
queryViewTasks returns a list of tasks that match the criterion specified in the view such as columns, optional info, assignmentFilter, keywords, predicate, ordering.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
viewId - the view id of the view whose tasks need to be retrieved (Views can be created using IUserMetadataService)
extraPredicate - optional extra Predicate on top of the view predicate for filtering the tasks.
defaultOrdering - the default ordering criteria that overrides view ordering for sorting the tasks
startRow - the rownum of the starting row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
endRow - the rownum of the ending row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while querying tasks

queryViewAggregatedTasks

java.util.List<TaskCountType> queryViewAggregatedTasks(IWorkflowContext ctx,
                                                       java.lang.String viewId,
                                                       Predicate extraPredicate,
                                                       Column defaultGroupByColumn,
                                                       boolean defaultOrderByCount,
                                                       boolean defaultAscendingOrder)
                                                       throws WorkflowException
Executes the query as defined in the specified view, and agregates the selected tasks according to the chart property defined in the view. The chart property of a view is an instance of a ChartType, and defines the following properties: If no chart property is defined for the view, then the default values specified in the call to this method will be used instead. An additional predicate can be optionally specified to further restrict the tasks queried by the view.
Parameters:
ctx - ctx the workflow context (can contain valid token or credentials)
viewId - the view id of the view whose tasks need to be retrieved (Views can be created using IUserMetadataService)
extraPredicate - optional extra Predicate on top of the view predicate for filtering the tasks.
defaultGroupByColumn - if the view does not specify a chart groupBy column this parameter specifies the to be used group the task counts.
defaultOrderByCount - specifies how tasks counts should be ordered if the view does not specify ordering.
defaultAscendingOrder - specifies how tasks counts should be ordered if the view does not specify ordering.
Returns:
a List of TaskCountType objects. Each TaskCountType object has a value field containing a value from the groupBy column and a count field containing the number of tasks that have that value.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

countViewTasks

int countViewTasks(IWorkflowContext ctx,
                   java.lang.String viewId,
                   Predicate extraPredicate)
                   throws WorkflowException
Counts the number of tasks that match the query criteria of the specified view. Using this method is generally more performant than using queryViewTasks and getting the size of the returned List.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
viewId - the view id of the view whose tasks are to be counted.
extraPredicate - optional extra Predicate on top of the view predicate for filtering the tasks.
Returns:
int number of tasks that match the specified view, and additional predicate (if any). If no tasks are found, returns 0.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

doesViewTaskExist

boolean doesViewTaskExist(IWorkflowContext ctx,
                          java.lang.String viewId,
                          Predicate extraPredicate)
                          throws WorkflowException
Checks to see if any tasks exist match the query criteria of the specified view. Using this method is generatlly more performant than using queryViewTasks or countViewTasks, especially where a large number of tasks match the query criteria.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
viewId - the view id of the view whose tasks are to be counted.
extraPredicate - optional extra Predicate on top of the view predicate for filtering the tasks.
Returns:
boolean true if any tasks match the specified query criteria, otherwise false.
Throws:
WorkflowException - if any runtime error occurs while querying tasks.

queryTaskErrors

java.util.List<oracle.bpel.services.workflow.task.error.model.TaskError> queryTaskErrors(IWorkflowContext ctx,
                                                                                         Predicate predicate,
                                                                                         Ordering ordering,
                                                                                         int startRow,
                                                                                         int endRow)
                                                                                         throws WorkflowException
queryTaskErrors returns a list of TaskError objects matching the specified predicate
Parameters:
ctx - the workflow context (can contain valid token or credentials)
predicate - the predicate for filtering the task errors
ordering - the ordering criteria for sorting the task errors
startRow - the rownum of the starting row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
endRow - the rownum of the ending row for this query (paging size is 200; results are returned in bunches of 200 even if the difference between startRow and endRow is greater than 200)
Returns:
Throws:
WorkflowException

getTaskHistory

java.util.List getTaskHistory(IWorkflowContext ctx,
                              java.lang.String taskId)
                              throws WorkflowException
Deprecated. use @link{#getTaskHistory(IWorkflowContext, String, List)} instead.
getTaskHistory returns a list of historical task versions for the specified taskId.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskId - the id of the task whose history is needed
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while getting task versions

getTaskHistory

java.util.List<Task> getTaskHistory(IWorkflowContext ctx,
                                    java.lang.String taskId,
                                    java.util.List<java.lang.String> displayColumns)
                                    throws WorkflowException
getTaskHistory returns a list of historical task versions for the specified taskId.
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskId - the id of the task whose history is needed
displayColumns - a list containing names of columns to be retrieved
 For those columns that are not specified here, the queried Task object will not hold any value.
 For example: If TITLE is not specified, task.getTitle() will return null
 For the complete list of columns that can be specified here, check the table shown above
 
 If displayColumns is null or has no elements, then the following columns will be returned
 by default:

  
Column
WFTASKHISTORY_TASKID_COLUMN
WFTASKHISTORY_TASKGROUPID_COLUMN
WFTASKHISTORY_TASKNUMBER_COLUMN
WFTASKHISTORY_VERSION_COLUMN
WFTASKHISTORY_VERSIONREASON_COLUMN
WFTASKHISTORY_STATE_COLUMN
WFTASKHISTORY_ASSIGNEES_COLUMN
WFTASKHISTORY_UPDATEDDATE_COLUMN
WFTASKHISTORY_UPDATEDBY_COLUMN
WFTASKHISTORY_USERCOMMENT_COLUMN
WFTASKHISTORY_OUTCOME_COLUMN

 
Returns:
a list of Task objects
Throws:
WorkflowException - if any runtime error occurs while getting task versions

getTaskDetailsById

Task getTaskDetailsById(IWorkflowContext ctx,
                        java.lang.String taskId)
                        throws WorkflowException
getTaskDetailsById gets the details of a task whose id is taskId
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskId - the id of the task whose details are needed
Returns:
an Task object
Throws:
WorkflowException - if any runtime error occurs while getting task details

getTaskDetailsByNumber

Task getTaskDetailsByNumber(IWorkflowContext ctx,
                            int taskNumber)
                            throws WorkflowException
getTaskDetailsByNumber gets the details of a task whose number is taskNumber
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskNumber - the number of the task whose details are needed
Returns:
an Task object
Throws:
WorkflowException - if any runtime error occurs while getting task details

getTaskVersionDetails

Task getTaskVersionDetails(IWorkflowContext ctx,
                           java.lang.String taskId,
                           int versionNumber)
                           throws WorkflowException
getTaskVersionDetails gets the task version details of a task whose id is taskId for the version denoted by versionNumber
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskId - the id of the task whose details are needed
versionNumber - the version number of the task
Returns:
an Task object
Throws:
WorkflowException - if any runtime error occurs while getting task details

getTaskSequence

TaskSequence getTaskSequence(IWorkflowContext ctx,
                             Task task,
                             java.util.List<java.lang.String> taskDisplayColumns,
                             java.util.List<ITaskQueryService.TaskSequenceType> taskSequenceType,
                             java.util.List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext,
                             boolean fetchTaskSequenceForRootTask)
                             throws WorkflowException
 getTaskSequence gets the task sequence tree of a task whose id is taskId,
 for those type of sequence specified in sequenceTypes
 There are 4 types of objects in the returned tree. Each of these objects 
 implement the ITaskSequence interface.
 
  1. TaskSequence. This node represents a sequence of nodes. This node is always the root object and will also be the wrapper around a parallel branch if there is more than one node in that branch. The objects in the getChildren() method could be Parallel, SequenceGroup or TaskSequenceRecord.
  2. Parallel. This node represents a parallel events in the task. Each node in the getChildren() method represents one parallel branch. The objects in the getChildren() method could be Sequence, SequenceGroup, Parallel or TaskSequenceRecord. If there are more than one node in any parallel branch, then all those nodes will be wrapped by a Sequence object. If the client wants each parallel branch to be wrapped with a TaskSequence object, it could pass TaskSequenceBuilderContext.INCLUDE_SEQUENCE_FOR_SINGLE_CHILD in the List<TaskSequenceBuilderContext> parameter of the getTaskSequence method.
  3. SequenceGroup. The SequenceGroup object represents a sequence of nodes that are grouped because they belong to the same workflow pattern like management chain or sequential participant. The objects in the getChildren() method are always TaskSequenceRecord objects. By default there will be no SequenceGroup objects. If the client wants workflow patterns to be captured as SequenceGroup objects in the TaskSequence tree, it could pass TaskSequenceBuilderContext.WORKFLOW_PATTERN in the List<TaskSequenceBuilderContext> parameter of the getTaskSequence method.
  4. TaskSequenceRecord. This object represents actual update to the task or a future assignment. It doesn't have any children.

 Attributes in each of ITaskSequence objects are:
 
 
Attribute TaskSequence Parallel SequenceGroup TaskSequenceRecord
Id Not populated by default Not populated by default Not populated by default Not populated by default
SequenceNumber Populated by default Populated by default Populated by default Populated by default
Label Not applicable The name of the parallel pattern as specified during design time The name of the workflow pattern node as specified during design time The name of the workflow pattern node as specified during design time
Pattern Not applicable ITaskSequence.Pattern.Parallel ITaskSequence.Pattern.ManagementChain or ITaskSequence.Pattern.SequentialParticipant ITaskSequence.Pattern.*
Name Not applicable Same as label Same as label Concatenated string of the assignees
FlexString1-5 Not populated by default. Available for clients to set additional attributes on nodes in the tree Not populated by default. Available for clients to set additional attributes on nodes in the tree Not populated by default. Available for clients to set additional attributes on nodes in the tree Not populated by default. Available for clients to set additional attributes on nodes in the tree

 
 
 Note:
 
  1. None of the attributes are set on the root TaskSequence object.
  2. ITaskSequence.Pattern.Stage and TaskSequenceBuilderContext.STAGE are reserved for future use.

 
 Retrieving the task sequence with either the task or taskid
 TaskSequence can be retrieved with either the task or the task id. The usage is shown below:
 
      ITaskQueryService querySvc = ...
      List<ITaskQueryService.TaskSequenceType> sequenceTypes =
          new ArrayList<ITaskQueryService.TaskSequenceType>();
      sequenceTypes.add(ITaskQueryService.TaskSequenceType.ALL);
 
      List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext =
          new ArrayList<ITaskQueryService.TaskSequenceBuilderContext>();
      taskSequenceBuilderContext.add(ITaskQueryService.TaskSequenceBuilderContext.WORKFLOW_PATTERN);
 
      TaskSequence taskSequence =
          querySvc.getTaskSequence(ctx, task, null, sequenceTypes,
                                   taskSequenceBuilderContext, true);
 or
      TaskSequence taskSequence =
          querySvc.getTaskSequence(ctx, taskId, null, sequenceTypes,
                                   taskSequenceBuilderContext, true);

 
 
 Retrieving the task sequence before initiating the task
 TaskSequence can be retrieved without initiating the task, in which case the task sequence 
 will contain only the future participants. To do this, clients have to set the task definition id 
 in the task. The task definition id is either the targetNamespace of the corresponding .task file
 or the id created for the deployed workflow component during deployment. The usage is shown below:
 
      ITaskQueryService querySvc = ...
      Task task = new ObjectFactory().createTask();
      Element inputPayload = getInputPayload();
 
      // optionally set the task creator
      task.setCreator(name);
 
      // optionally set the task payload
      Document document = XMLUtil.createDocument();
      Element payloadElem = document.createElementNS(TASK_NS, "payload");
      Element cloneTemp =
          (Element)document.importNode(inputPayload, true);
      payloadElem.appendChild(cloneTemp);
      document.appendChild(payloadElem);
      task.setPayloadAsElement(payloadElem);
 
      List<ITaskQueryService.TaskSequenceType> sequenceTypes =
          new ArrayList<ITaskQueryService.TaskSequenceType>();
      sequenceTypes.add(ITaskQueryService.TaskSequenceType.ALL);
 
      List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext =
          new ArrayList<ITaskQueryService.TaskSequenceBuilderContext>();
      taskSequenceBuilderContext.add(ITaskQueryService.TaskSequenceBuilderContext.WORKFLOW_PATTERN);
 
      TaskSequence taskSequence =
          querySvc.getTaskSequence(ctx, task, null, sequenceTypes,
                                   taskSequenceBuilderContext, true);
 
 
 Setting additional attributes on the retrieved task sequence
 It is often necessary for the clients to set other data on the task sequence before using it. For 
 example, the client might want to dispaly the task sequence in a table with some image hints 
 based on pattern. The following code illustrates use of the flex strings to do this:
 
    TaskSequence taskSequence = ...;
    setImage(taskSequence);
 
    private void setImage(ITaskSequence taskSequence) {
        ITaskSequence.Pattern pattern = taskSequence.getPattern();
        System.out.println(pattern);
        if (pattern == ITaskSequence.Pattern.ManagementChain) {
            taskSequence.setFlexString1("sequential.png");
        } else if (pattern == ITaskSequence.Pattern.Parallel) {
            taskSequence.setFlexString1("parallel.png");
        } else if (pattern == ITaskSequence.Pattern.Participant) {
            taskSequence.setFlexString1("user.png");
        } else if (pattern == ITaskSequence.Pattern.SequentialParticipant) {
            taskSequence.setFlexString1("sequential.png");
        }
 
        List children = taskSequence.getChildren();
        if (children != null) {
            for (int index = 0; index < children.size(); index++) {
                ITaskSequence taskSequenceChild =
                    (ITaskSequence)children.get(index);
                setImage(taskSequenceChild);
            }
        }
    }
 
 
 Setting additional attributes on the retrieved task sequence
 The following code shows how to create an ADF TreeModel from the task sequence
 
    List rootListNode = new ArrayList();
    rootListNode.addAll(taskSequence.getChildren());
    org.apache.myfaces.trinidad.model.TreeModel treeModel = new ChildPropertyTreeModel(rootListNode, "children");
 
 
Parameters:
ctx - the workflow context (can contain valid token or credentials)
task - the task whose details are needed
taskDisplayColumns - the task columns to query
sequenceTypes - a list containing type of task sequence type to be retrieved
taskSequenceBuilderContext - a list containing context to the task sequence true builder
fetchTaskSequenceForRootTask - If true, get the task sequence for the root task, else get the task sequence for the current task. The root task is the main task which could have sub tasks that represent parallel tasks
Returns:
an TaskSequence object, which the represents the task sequence tree
Throws:
WorkflowException - if any runtime error occurs while getting task sequence

getTaskSequence

TaskSequence getTaskSequence(IWorkflowContext ctx,
                             java.lang.String taskId,
                             java.util.List<java.lang.String> taskDisplayColumns,
                             java.util.List<ITaskQueryService.TaskSequenceType> taskSequenceType,
                             java.util.List<ITaskQueryService.TaskSequenceBuilderContext> taskSequenceBuilderContext,
                             boolean fetchTaskSequenceForRootTask)
                             throws WorkflowException
Parameters:
ctx - the workflow context (can contain valid token or credentials)
taskId - the taskId of the task whose details are needed
taskDisplayColumns - the task columns to query
sequenceTypes - a list containing type of task sequence type to be retrieved
taskSequenceBuilderContext - a list containing context to the task sequence true builder
fetchTaskSequenceForRootTask - If true, get the task sequence for the root task, else get the task sequence for the current task. The root task is the main task which could have sub tasks that represent parallel tasks
Returns:
an TaskSequence object, which the represents the task sequence tree
Throws:
WorkflowException - if any runtime error occurs while getting task sequence
See Also:
getTaskSequence(oracle.bpel.services.workflow.verification.IWorkflowContext, oracle.bpel.services.workflow.task.model.Task, java.util.List, java.util.List, java.util.List, boolean)

getPermittedAssignees

oracle.bpel.services.workflow.task.IRestrictedAssignees getPermittedAssignees(IWorkflowContext ctx,
                                                                              Task task,
                                                                              java.lang.String operation)
                                                                              throws WorkflowException
getPermittedAssignees gets a list of users to whom the current task can be reassigned to by the current user.
Parameters:
ctx - the workflow context.
task - the task being operated upon
operation - the operation. One of the constants from the call back interface.
Returns:
a IRestrictedAssignees object representing the permitted users set.
Throws:
WorkflowException - if any runtime error occurs while obtaining the list of users.

Skip navigation links

Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1)
E10660-03


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.