I’m having a process which contains a few user tasks, followed by a service task, which generates and deploys a new bpmn model instance. This instance is called as a subprocess after the service task.
This basically works so far.
Furthermore I have a global task listener which should be notified for all creation events see User Guide.
This works fine for the first user tasks, but it does not work for the user task which is contained in the generated model instance of the subprocess. No Assignment or Creation events are triggered, only the Start Event is caught by another global execution listener.
In the Camunda Cockpit [Apache Tomcat deployment] I can see that the token is at the user task.
Any idea what could be wrong?
Any suggestions or further questions to clarify the problem?
The listener is defined on process application level, so it only gets callbacks for deployments that are registered with the respective application. For processes that are deployed automatically as part of the application deployment, this happens automatically. For manual deployments, you have to do that yourself either via
RepositoryService#createProcessApplicationDeployment or via
ManagementService#registerProcessApplication. You should also use the latter to re-register deployments whenever you restart the application. You can obtain the required
ProcessApplicationReference object by calling
#getReference on your process application object.
thanks a lot for your help. Although I could not really figure out where I would find the method
RepositoryService#createProcessApplicationDeployment, the second approach you suggested helped and solved my issue!
Best regards, Hendrik