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?
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:
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.