Process Measurement Tuning Process Analytics

Oracle Human Workflow Performance Tuning 16-3 Example: To retrieve all assigned tasks for a user with priority = 1, you can use the following API call: Predicate pred = new PredicateTableConstants.WFTASK_STATE_COLUMN, Predicate.OP_EQ, IWorkflowConstants.TASK_STATE_ASSIGNED; pred.addClausePredicate.AND, TableConstants.WFTASK_PRIORITY_COLUMN, Predicate.OP_EQ, 1; List tasks = querySvc.queryTasksctx, queryColumns, null, ITaskQueryService.AssignmentFilter.MY ITaskQueryService.AssignmentFilter.MY, null, pred, null, startRow, endRow;

16.2.4 Retrieve Subset of Qualifying Tasks Paging

Once the task list has been narrowed down to meet a specific criteria as discussed in the previous section, the next level of filtering is based on how many tasks are to be presented to the user. You want to avoid fetching too many rows, which not only increases the query time but also increases the application process time and the amount of data returned to client. The query API has paging parameters that control the number of qualifying rows returned to the user and the start row. For example, in the queryTasks method: List tasks = querySvc.queryTasksctx, queryColumns, null, ITaskQueryService.AssignmentFilter.MY, null, pred, null, startRow, endRow; Consider setting the startRow and endRow parameters to values that may limit the number of return matching records.

16.2.5 Fetch Only the Information That Is Needed for a Qualifying Task

When using the queryTask service, consider reducing the amount of optional information retrieved for each task returned in the list. This may reduce the performance impacts from additional SQL query and Java logic. For example, in the following queryTasks method, only the group actions information is retrieved. You can also retrieve attachment and payload information directly in the listing, but you may encounter performance impacts. ListITaskQueryService.OptionalInfo optionalInfo = new ArrayListITaskQueryService.OptionalInfo; optionalInfo.addITaskQueryService.OptionalInfo.GROUP_ACTIONS; optionalInfo.addITaskQueryService.OptionalInfo.ATTACHMENTS; optionalInfo.addITaskQueryService.OptionalInfo.PAYLOAD; List tasks = querySvc.queryTasksctx, queryColumns, 16-4 Oracle Fusion Middleware Performance and Tuning Guide optionalInfo, ITaskQueryService.AssignmentFilter.MY, null, pred, null, startRow, endRow; In rare cases where the entire payload is needed, then the payload information can be requested. Typically only some of the payload fields are needed for displaying the task list. For example, for PO Tasks, the PO amount may be a column that must be displayed. Rather than fetching the payload as additional information and then retrieving the amount using an xpath expression and displaying it in the listing, consider mapping the amount column from the payload to a flex field. The flex field can then be directly retrieved during SQL querying which may significantly reduce the processing time. Similarly, for attachments where the name of the attachment is to be displayed in the listing and the document itself is stored in an external repository, consider capturing the attachment name in the payload and mapping it to a flex field, so that processing time is optimized. While constructing the listing information, the link to the attachment can be constructed by fetching the appropriate flex field.

16.2.6 Reduce the Number of Return Query Columns

When using the queryTask service, consider reducing the number of query columns to improve the SQL time. Also, try to use the common columns as they are most likely indexed and the SQL can execute faster. For example, in the following queryTasks method, only the TASKNUMBER and TITLE columns are returned: List queryColumns = new ArrayList; queryColumns.addTASKNUMBER; queryColumns.addTITLE; ... List tasks = querySvc.queryTasksctx, null, ITaskQueryService.AssignmentFilter.MY, null, pred, null, startRow, endRow;

16.2.7 Use the Aggregate API for Charting Task Statistics

Sometimes it is necessary to display charts or statistics to summarize task information. Rather than fetching all the tasks using the query API, and computing the statistics at the client layer, consider using the new aggregate APIs to compute the statistics at the database level. For example, the following call illustrates the use of the API to get summarized statistics based on state for tasks assigned to a user: List taskCounts = querySvc.queryAggregatedTasksctx, Column.getColumnWFTaskConstants.STATE_COLUMN, ITaskQueryService.AssignmentFilter.MY, keyWordFilter, filterPredicate, false,