seartTask order and priority criteria

Hello:

We are introducing priority in tasks and we want to get the default inbox with these task. We realized that searchTask api service doesn’t provide a mean to specify an order result or even don’t bring the tasks with the higher priority.

For example: invoking searchTask with userId and maxResults=60 ignore the task with High priority.

If you know how searchTask works, please do let me know.

Best regards.

Norberto.

Hi Norberto

You can specify the priority inside input TaskSearchQuery[b]Terms[/b]
Terms is a list of TaskSearchQueryTerm. For searching on priority populate the parameter, Fields as priority and then set required operator and value.

Mervin:

I did that. I know I have 2 activities with priority “High”, the others are “none”. I did a search for tasks "in ‘High’ and ‘none’, maxResults=60 (total tasks = 1100), and searchTask doesn’t return the hgh task priority.

Best regards.

did you try with the value “high” as well? values may be case sensitive

Hi Mervin:

Yes I did. But I guess is not a problem with the search. The problem seems to be with the order which searchTask return the activities, because is not choosing the high priority tasks first instead the others.

Best regards.

Hi Norberto,

Did you manage to fix the problems?

From your posts it is not clear if you use the “Priority” field from the TaskInfo or you have defined a “Priority” field in you business data.

Some MWS fix packs had bugs when searching after business data fields that have the same name with fields from TaskInfo.

Also, can you check how the search query looks in the logs? Also you can modify the log level in order to see the SQL query that is executed on the DB.

Hope it helps,
Vlad Turian

Hi Vlad:

No, I don’t.

The priority field is the field in the TaskInfo.

Regards.

Hi,

Can you please share your MWS fix pack level and the webMethods version you are using?

Also to state the problem clear: It is not possible for you to sort after the priority field when searching for tasks using the searchTasks IS service?

Cheers,
Vlad Turian

We’re in v8.0 and moving to 9.7.

Service api searchTask don’t sort results. That’s the info we have for that problem.

Hi Norberto,

Unfortunately you are right.

You cannot sort the results you have using the searchTasks service.

That is why, when creating a task application the sort is done on the CAF table component and associated provider and not on the actual DB.

Actually here there is a predefined sort in place (I think it is after task id).

If you want to be able to sort I recommend using the searchTasksIndexed service which allows you to specify the field you want to sort by (sortBy) and the sort order (sortOrder): ASC or DESC.

For searchTasksIndexed to work your tasks have to be indexed.

If you search only after the priority or other task info fields you can try searchTasksIndexed service. It might work even if your tasks are not indexed.

Cheers,
Vlad Turian

Thx Vlad.

Best regards.