We have a process where the default flow involves numerous UserTasks interleaved by ServiceTasks, where the ServiceTasks invoke a backend.
Now a use case has come up where we need to make the same backend calls, but not interleaved with UserTasks - in a way, “headless” execution.
A “naive” implementation would just model a second path which only consists of the service tasks.
In OO one could use the template method design pattern, i.e. write a template method in an abstract base class which invokes the services, and in between calls out to abstract methods that may or may not implement user interfaces.
Is there a way to achieve something similar in BPMN?
To illustrate the idea, I could have a flow which does everything, but instead of user tasks invokes CallActivities. The sub processes can either contain the user tasks or a noop process. The calledElement of the CallActivities would have to be an expression, so that the process could control in advance, if the noop or the UI subprocess should be called.
Almost there, but what I am actually looking for is a mechanism which corresponds to “implementing an abstract process”.