Embedded subroceess

Morning,

I have an embedded sub-process that I would like to reuse in a main process. Please see diagram below:

When I try to execute main process I got:
ENGINE-16004 Exception while closing command context: No initial activity found for subprocess SubProcessActivity: initialActivity is null

I know that there is a way to re-use not embedded sub-process by Call Activity task, but I prefer to keep my sub-process embedded.

Is there any similar to Call Activity way to invoke an embedded sub-process.

Thank you,
Mike

@mshauneu just use pools:

this gives you a single BPMN file and a single view.

1 Like

Thank you @StephenOTT for the answer.

You describe working solution (just tested). It is definitely helps to organize processes much from process designer perspective.
But from BPM engine standpoint, in this case, we have two different processes.

My question is about sub-processes.

Imagine situation. You have workflow that have some steps that repeat from time to time. These steps so titled to the main process that there is no chance that they will be re-used outside of the main process. Follow DRY principles we want to extract repeating steps in some kind of “procedure/function” and just apply it in place. Steps contains a bunch of logic that is not good to encapsulate into a Delegate.

As far as I understand BPMN supports sub-processes through Sub Process Collapsed task. Look for instance at http://mainthing.ru/item/446/

My question: is it possible to implement it using camunda engine?

Thank you in advance,
Mike

What is wrong with two processes? What aspects are you concerned about?

Collapsed task does not mean “callable”, it means the sub process is within the sequence flow.

You could also work with Event Sub Processes, and call your Event Subprocess through a Conditional Event.