Designer 10.15 | webMethods BPM Task Development Help | Working with Task Searches | Searching Indexed Data in a Custom Task Inbox
 
Searching Indexed Data in a Custom Task Inbox
When you create a custom task inbox (also known as a task type inbox), you can add a Task Inbox Results portlet to the portlet application to display search results.
For example, you can use the following search provider bindings expressions:
{"#{taskSearchProvider.searchQuery.myField.fields}", "MyIndex"},
{"#{taskSearchProvider.searchQuery.myField.operator}", "="},
{"#{taskSearchProvider.searchQuery.myField.value}",
"#{activePageBean.activeSearchQuery.refineFields[\"myField\"]}"},
where “MyIndex” is the indexed field database name, and “myField” is the search term.
Note:
By default, searches for custom task fields are case-sensitive. If you want to enable case-insensitive searches, see Implementing Case-Insensitive Searching.
Searching Indexed Data in Multiple Task Inboxes
By default, searches in the custom task inbox are limited to the task type associated with the custom task inbox. If the task type uses a standard search provider, you can configure the Task Inbox Results portlet to search all task types. For more information, see Task Client Option Definitions.
However, if the task type uses an indexed business data search provider, you must use the following procedure to extend the search to other task types.
Note:
This procedure can also be applied to task types with a standard search provider if you want to limit the number of task types in the search.
If you plan to use the “search all task types” feature with task types that have indexed business data, be aware of the following points:
*For consistent search results, all task types with indexed data must use identical indexed field names. For example, indexed field names such as Order_number, order_number, and orderNumber, are seen by the Task Engine as three different fields. A search against any one of them will not include results from the other two fields. Task developers must take care to ensure that indexed field names are consistent across task types. For example:
Suppose the task type “OrderClaim” contains a field "OrderZipCode", and the task type “CustomerClaim” contains a field "CustomerZipCode". If you want to search both task types together for the zip code value, you must ensure that these differently named fields have the same index name (such as "ZipCode").
*Similarly, best practices dictate that all indexed data fields of the same name contain information of the same type. For example, an indexed field named SalesPriority might have some entries in numerical format (“3”) and some in text format (“Medium”). For consistent results, avoid this situation.
*If the named indexed data field is used for different field types in other task types, all tasks containing the indexed data field name will be included in the search results, regardless of the field type.
Important:
Do not select the task option Search all task types when searching for task type inbox results when implementing the following procedure. Doing so will cause a search to fail and will generate an error. For more information about this option, see Modifying Client Options for a Task and Task Client Option Definitions.
Note:
With the standard search provider, the API supports multiple fields per term, and it is possible to modify the Task Search Results view .java file to specify multiple search fields per term. This is not supported for the indexed search provider; you are limited to one field per term.
*To search for an indexed business data field across multiple task types
1. In Designer, add the indexed data field to the task search interface, as described in Creating Custom Search Fields from Task Business Data.
2. Click Navigate > Open Type.
3. In the Open Type dialog box, type the task type name that you want work with.
4. In the resulting list, double-click the entry for:
taskTypeNameInboxResultsDefaultviewView
5. In the resulting text editor, locate the following method in the .java file:
private static final String[][] TASKSEARCHPROVIDER_PROPERTY_BINDINGS
6. Locate the task type ID value definition containing the current task type ID:
{"#{taskSearchProvider.searchQuery.taskTypeID.value}", "taskTypeID1"},
7. To specify additional task type IDs to include in the search, add the task type IDs for those task type to the task type ID value definition, separated by commas. For example:
{"#{taskSearchProvider.searchQuery.taskTypeID.value}", "taskTypeID1, taskTypeID2, taskTypeID3"},
Important:
Do not remove the task type ID value definition. With standard searches, removing this element enables a search of all task types. However, with an indexed business data field search, removing this element will cause an error.
8. Save the file. The task type is now enabled for searching for the indexed business data field in the specified task types.
Related Topics