Java Query API: or/endOr for all queries or at least process instance queries

Hello,

I’m about to implement or/endOr for process instance queries or is there already a plan to implement this feature?

I opened a ticket in Jira a while ago (CAM-9676) but there were no changes to it since then, so I decided I give it a try myself, any objections?

Kind regards,
Fabian

1 Like

Refer this https://github.com/camunda/camunda-docs-manual/blob/master/content/user-guide/process-engine/process-engine-api.md

Thanks for the link, wasn’t aware of some of the features like the custom queries and never saw a native query example before tbh, but still I think it would be a good addition to the engine to have the OR queries for at least the process instances.

1 Like

Hello,

I’m more or less done with the or/endOr feature for process instance, historic process instance and historic task queries, but I’m not able to initialize the or queries or variables like in the TaskQueryImpl, I’m getting a NPE when trying to access the ProcessEngineConfiguration which seems to be null in the current Context. Does anybody have an idea why the ProcessEngineConfiguration is null for the HistoricProcessInstanceQuery?

Here is the stacktrace I’m getting:

java.lang.NullPointerException: while trying to invoke the method org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.getVariableSerializers() of a null object returned from org.camunda.bpm.engine.impl.context.Context.getProcessEngineConfiguration()
    at org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl.ensureVariablesInitialized(HistoricProcessInstanceQueryImpl.java:408)
    at org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl.executeList(HistoricProcessInstanceQueryImpl.java:378)
    at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressionsAndExecuteList(AbstractQuery.java:189)
    at org.camunda.bpm.engine.impl.AbstractQuery.list(AbstractQuery.java:142)

And here are my current sources (based on the tag of 7.10.0):

Any help is appreciated

Hello again,

FYI: I found the issue regarding the NPE, it was more or less related to my application which uses camunda. It’s a spring application with separate application database and camunda database and I was switching the transaction context from my spring and the camunda context within one bean which is not a good idea.

So I’m about to finalize the OR conditions feature and then I’m going to raise a PR.

Regards,
Fabian

Hi Fabian,

That sounds great, we are looking forward to your pull request.

Cheers,
Thorben

1 Like

Pull request created:

Hope you’ll like it :grinning: