cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple OR Statement

mysterejack
Champ in-the-making
Champ in-the-making
Hi everybody,

I'm trying to do an HistoricProcessInstanceQuery with multiple OR.

My use case is the following :

- I have multiple instances of process with 2 variables A and B. Values for A can be 1, 2, 3 and values for B can be 5,6,7.
- I'm trying to find process instances with variables (A1 OR A2) AND (B5 OR B7).

I'm totally blocked. My request can be (A1 OR A2 OR B5 OR B7) or (A1 AND A2 AND B5 AND B7) … but this is not the way I've to implement my business requirement.

Could you please advise me on this case ? I really don't understand why it's impossible to have multiple OR statements in one query ?

Thanks a lot,
1 REPLY 1

trademak
Star Contributor
Star Contributor
In the javadoc of the or method the following statement is made about this:

Begin an OR statement. Make sure you invoke the endOr method at the end of your OR statement. Only one OR statement is allowed

So your use case is currently not supported ootb. You could use a native historic process instance query though and write the SQL yourself to make this work.

Best regards,