ProcessApi

As per definition processApi.getActivites is supposed to show both open and completed activites.
For one requirment, to show like Routing slip. I am trying to write a method which gives all the completed Flow node for given RootContainerID.

But when I am using processApi.getActivities for getting this. I am getting only Active Flow node instances.
How can we get all the active and completed tasks and timers?

Thanks in Advance

Hi,

When a flowNode (for any type activity, task, timer, etc.) is completed, It is stored as an ArchivedFlowNode, then you cannot get them using the getActivities method, you have to use a getArchived*WhatYouWant* or searchArchived*WhatYouWant* method.

In this case you can use [getArchivedActivityInstance][], [getArchivedActivityInstances][] or [searchArchivedActivities][], click for more information.

It’s important you know that when the flownode complete every state, it is drop from the active objects and is stored with the archived, this means that the id for the active object IS NOT the same id for the archived and there are more than one archived object for an “active” (one for each state change). You can find the id for the active object on the sourceObjectId property for the archived object.

I hope it helps.

PD: It seems the links are not working, use these:

PD: It seems the links are not working, use these:
getArchivedActivityInstance: http://documentation.bonitasoft.com/javadoc/api/7.3/org/bonitasoft/engine/api/ProcessRuntimeAPI.html#getArchivedActivityInstance(long)
getArchivedActivityInstances: http://documentation.bonitasoft.com/javadoc/api/7.3/org/bonitasoft/engine/api/ProcessRuntimeAPI.html#getArchivedActivityInstances(long,%20int,%20int,%20org.bonitasoft.engine.bpm.flownode.ActivityInstanceCriterion)
searchArchivedActivities: http://documentation.bonitasoft.com/javadoc/api/7.3/org/bonitasoft/engine/api/ProcessRuntimeAPI.html#searchArchivedActivities(org.bonitasoft.engine.search.SearchOptions)