-
Feature Request
-
Resolution: Done
-
Major
-
7.30.0.Final
-
None
-
None
Hi,
We have registered this custom query in order to search tasks:
{
"query-name" : "jbpmHumanTasksPO",
"query-source" : "${org.kie.server.persistence.ds}",
"query-expression" : "select t.id as TASKID, t.name as NAME, t.FORMNAME AS FORMNAME, t.subject as SUBJECT, t.actualowner_id as actualowner, po.entity_id as POTOWNER, p.processinstancedescription as PROCESSINSTANCEDESCRIPTION, t.CREATEDON as CREATEDON, t.CREATEDBY_ID as CREATEDBY, t.EXPIRATIONTIME as EXPIRATIONTIME, t.priority as PRIORITY, t.STATUS as STATUS, t.PROCESSINSTANCEID as PROCESSINSTANCEID, t.deploymentid as DEPLOYMENTID, t.PROCESSID as PROCESSID from TASK t inner join PEOPLEASSIGNMENTS_POTOWNERS po on t.id=po.task_id inner join PROCESSINSTANCELOG p on t.processinstanceid = p.processinstanceid",
"query-target" : "USER_GROUPS_TASK"
}
One of the filters that our customers need to use it's: all the task which the logged user is potential owner or is reserved by the logged user, but they don't want to get the tasks which are already reserved by another user even if the task contains as a potential owner the logged user. This is the where clause that we should get with the query:
select ...... from .... where PROCESSID = 'XXX' and STATUS in ("Ready","Reserved","In-progress") and POTOWNER = 'logged_user' and (ACTUALOWNER = 'logged_user' OR ACTUALOWNER is null)
Are there any way to set this filter in the payload of a custom query? I mean, how can I use the operator "OR" in a custom query?
The following body doesn't work fine because all the parameters are translate to "AND" conditions:
{
"order-by": "actualOwner",
"order-asc": false,
"query-params": [
,
,
,
,
{"cond-column":"ACTUALOWNER","cond-operator":"EQUALS_TO","cond-values":["XE70344"]} ]
}
But we need that the last 2 query parameters , related to the actualowner, were an "OR" clause.
- is cloned by
-
RHPAM-2711 How to use a "OR" query operator in a custom query in the query-parameters
- Closed