Hello Mahmoud,
We need to understand the business requirement first to provide you a technical solution.
As, @Rex Townsend mentioned, that the exposed variable scope is at the process instance level and what @Robin Rajan has mentioned in the first workaround would be the best way handle this technically if you want to stick to the OOTB REST APIs.
I would slightly update the solution provided by @Rex Townsend, like -
- Maintain a SOR table to save the task data
- Query the table to get the matching list of task ids
- Do a "Bulk Task Details" API call to retrieve the task details, that will have the business data associated with the tasks.
If you want to try task narratives, you can add complex object in the task narrative which can be queried using Task Query Entity List [deprecated]
In this case, you can either use "IBM.DEFAULTALLTASKSLIST_75" saved search or create something similar which will have the "taskNarrative" column.
Please note: If a process instance level variable is directly mapped to the narrative, the narrative for all tasks having the same variable mapping will be updated as soon as the process level variable is updated.
Thanks!
------------------------------
Atanu Roy
Lead Engineer
London Stock Exchange Group
------------------------------
Original Message:
Sent: Thu November 16, 2023 08:48 AM
From: Mahmoud Abozaid
Subject: Search in BAW Tasks with filter in task scope not process instance scope using BAW rest exposed services
Hello All,
We developed a project that depends on BAW as a workflow engine and uses an external front-end framework not coaches. and so we use exposed rest services in BAW to start the workflow processes, get tasks of users, and other operations..
I faced a big issue when searching for tasks using variables mapped to those tasks.
As if we map the variable (ex:stepNumber)with different values to different activities (ex: stepNumber =1 mapped for userTask1 & stepNumber = 2 for userTask2) and search with that variable using search exposed service :
(https://BAW_Server_IP:9443/rest/bpm/wle/v1/search/querycolumns=stepNumber&condition=instanceProcessApp%7CTTS&organization=byTask&run=true&shared=false&filterByCurrentUser=false)
the response of API depicts two tasks that have the same value of a variable (stepNumber = 2). which means the variable is searched only as global scope for the same process instance and no task scope concept!
I need your support to solve these issue.
Assigned and data mapping for userTask1
Assigned and Data mapping variable for userTask 2:
------------------------------
Mahmoud Abozaid
------------------------------