I have a main process and a sub-process invoked as a ‘Call Activity’, implemented as shown below.
The Main Process Process A is implemented as a separate spring boot application, App A and deployed as a separate war. The sub-process Process B as well is implemented as a separate spring boot application App B and deployed as a separate war.
I am invoking certain listener and delegate classes implemented in App A from Process A and similarly Process B has certain listener and delegate classes implemented in App B.
However, i’m facing an issue while invoking the call-activity sub-process from the main process. It gives an error saying that the listener method/class configured in User Task B (i.e the first activity in Process B) ‘Class X not found’ or ‘Object not found’ even though it is present. However, subsequent tasks work fine and they are able to invoke all the methods configured in App B successfully. Surprisingly, if i configure, the ‘user Task B’ with some method implemented in ‘App A’, it does not throw the error and executes the method configured.
Same this happens when I come out of the sub-process to main process, i.e ‘Process A’. It gives a classNotFound error for any ‘App A’ method/class configured as listener/implementation in the first activity post coming out of the sub-process.
Can anyone please shed some light on what could be the issue here and how to work around this?
Here are the snapshots of both the main process Process A and sub-process Process B:
welcome to the world of heterogenous clusters build with spring boot apps. Here is a video from the CamundaCon where Abhishek shed some light into this: https://www.youtube.com/watch?v=Nx4I8lNMUs0&t=7s
Sorry about replying late on this topic. I had to continue this thread since we’ve started facing this issue again and in multiple places.
Similar to what Abhishek has suggested in the above video, we have made all our system tasks independent pieces of work, i.e , we’ve marked them ‘Asynchronous Before’ and ‘Asynchronous after’ so that each system task can be classified as a single independent unit of work and can be executed separately by the job executor and in case of any failure, the same system task can be the point of recovery.
However, every now and then in certain random scenarios, I still do get the error Unknown method used in expression {listener.xxx(arg1)}. Cannot find method with xxx with 1 parameter in class listener.
More so especially whenever we have a system task configured in an event sub-process OR when we transition from a main process to a call-activity which has a process defined in a different project/container.
Is it a recommended practice in Camunda to implement all the delegate classes/methods, listener classes/methods in one single project where the BPMN is deployed?
Provided you’re calling Java Classes directly from service tasks, Yes it is - but be aware you can also deploy multiple BPMN files in the same project.
Event subprocesses are started in the same transaction where the event is received and handled. Could you please describe the relationship of the event subprocess and and the failing transaction in more details? Same for the call activity: Where is the called process started and how is it handled?