Let's say I have two processes: pA of tenant tA and pB of tenant tB. I would like process pB to be a subprocess of process pA.
Is it possible out of the box? If not what should be modified?
Would it be enough to reimplement CallActivitiBehavior to make it select process with explicit tenantId givent as an extension element? If yes, please point me to the example of passing parameters from a bpmn to a behavior.
No, by default it looks for process definitions in the same tenant. An extension element could work indeed. You can use the RepositoryService in the behavior implementation to get the BpmnModel. Then you can get the call activity element definition and its extension elements.
Another requirement: I would like to run processes of tenant A and B in separate engines(will be developed by different suppliers) with common database.
So process pA should execute in engine of tenant A and subprocess pB started by process pA should execute in engine of tenant B.
How to tell activiti that is should start subprocess pB in jobExecutor thread of engine of tenant B?
We don't have specific support for this use case. The new async executor will execute the async job on the same Engine by default. So you would need to override the default job executor logic with your own implementation I think.