Topic
No replies
SystemAdmin
SystemAdmin
3556 Posts
ACCEPTED ANSWER

Pinned topic query against PROCESS_INSTANCES returns doubled rows

‏2013-02-05T11:41:26Z |
I use Business Flow Manager to query existing Process Instances in a java snippet inside a bpel. I always get 2 results, even I expect only 1 because I use a where condition on a PID.
Example query:

QueryResultSet result =
bfm.query("PROCESS_INSTANCE.PIID, PROCESS_INSTANCE.STATE, PROCESS_INSTANCE.CREATED", "PROCESS_INSTANCE.PIID = ID('" + myPid + "') AND (PROCESS_INSTANCE.STATE = PROCESS_INSTANCE.STATE.STATE_FAILED OR PROCESS_INSTANCE.STATE = PROCESS_INSTANCE.STATE.STATE_TERMINATED)", (String)null, (Integer)null, (TimeZone)null);
System.out.println(result.size());

I found somewhere in this forum I have to add the DISTINCT clause, but I would like to understand why I get more than a result.

Does anyone know the answer?
Thanks
MM