AnsweredAssumed Answered

Getting 'deployed' process from Repository/RuntimeService

Question asked by iravanchi on Sep 22, 2010
Latest reply on Jun 3, 2014 by martin.grofcik

I couldn't find any way for getting the "deployed" version of the process definition from the services provided by the engine.
Is there any way to do so?

As I browsed the code, ProcessDefinitionEntity contains the parsed structure for the process execution.
When a new execution is requested from RuntimeService, it uses DbRepositorySession, and loads and re-parses (or re-deploys) the process definition from the deployments, so that the activities are placed inside the ProcessDefinitionEntity and can be executed. (using deployExisting method in DbRepositorySession)

When loading the process definition using RepositoryService.findProcessDefinitionById, it is directly fetched from DB and returned, without that deployExisting thing, so the returned ProcessDefinitionEntity doesn't contain parsed activities.

Maybe adding these methods to RepositoryService can be a good idea:
* findDeployedProcessDefinitionById (parallel to findDeployedProcessDefinitionById in DbRepositorySession)
* find[Deployed]ProcessDefinitionByKey (there is no "by-key" alternative for this)