GetActivities Issue

I’m using Bonita BPM 6.3.8 with Java 1.6 and I’m attempting to get the state of the workflow via the process instance id.
However, getActivities is returning an empty list, and I can’t find the namedQuery “getActivitiesFromProcessInstance” to see what the query is looking for to explain why it isn’t finding anything.

ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
ProcessInstance proc = processAPI.startProcess(processAPI.getProcessDefinitionId(“Action Workflow”, “1.18”), variablesToSet);
List activities = processAPI.getActivities(proc.getId(), 0, 100);

If anyone could point me to where the namedQueries are stored, or rather the value of “getActivitiesFromProcessInstance”, that would be greatly appreciated.

Let me know if you need anymore info.

Thanks

First thing I found when doing this type of activity is that you need to wait…

In fact I ended up starting processes in one Service Task, passing a list of the ProcessInstance proc ids to a second Service task which is delayed by 5 seconds, then doing, in your example getActivities.

The speed of modern systems means your inline code (as above) will always be faster than a multithreaded instantiation of the other thread.

Hope this helps regards
Seán

Ha, this was in fact the issue. Good call. Thank you very much.