camunda/camunda-bpm-assert

[CMMN] calledProcessInstance() should return ProcessInstance called by ProcessTask

malteser opened this issue · 5 comments

Given a Case with a ProcessTask that calls a process A
When this task is started
And a new ProcessInstance for process A has been created
Then CmmnAwareTests.calledProcessInstance() should return that instance.

Oh, I should mention that this is a feature request, not a bug.

@malteser can this currently be done with a BPMN task? I am not seeing a way to get the specific process instance that was started from a specific execution?

With BPMN task you mean a task in the called process instance?

I want to navigate from an active process task to the process instance created by it. How could a task in that proces instance help me?

Process task is similar in function to a Call activity in BPMN. The problem I have found when using calledProcesaInstance is that It does not return the specific instance created by a call activity. It just calls the process instance that has a super of the Proxess instance that the call activity is in. This is a issue if you have multiple call activities in a single process that call the same sub process.

The functionality you describe is basically the same feature I am looking for at the BPMN level.
I solved this using a HistoryQuery:
https://github.com/DigitalState/Camunda-Spock-Testing/blob/feature-bpmn-coverage/camunda-7.9-conditional-start/src/test/groovy/conditionalstart/CallActivitySpec.groovy#L70-L75
But it's a annoying workaround

Hey guys,

we consider this a useful extension, but we will not work on CMMN features any time soon.
We encourage anyone to make a code contribution by submitting a pull request for this.

Closing this as Won't Fix, feel free to reopen or open up a feature request in the issue tracker.
Thank you for your understanding.

@StephenOTT, please don't hesitate to open a ticket for the engine part you mentioned in the issue tracker, describing the functionality you would like to see added.

Best,
Tobias