bpmn-engine
bpmn-engine copied to clipboard
How to support some more complex expressions in completionCondition?
Here's one of my bpmn snippets and it works just fine:
<bpmn2:multiInstanceLoopCharacteristics` camunda:collection="${environment.variables.handlers}" camunda:elementVariable="handler">
<bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">${environment.variables.handlers.length}</bpmn2:loopCardinality>
<bpmn2:completionCondition xsi:type="bpmn2:tFormalExpression">${content.output.passed}</bpmn2:completionCondition>
</bpmn2:multiInstanceLoopCharacteristics>
But when I need to use a more complex expression in completionCondition, and specify language="JavaScript",
such as content.output.passed == false
or content.output.passed+1==2
,the engine can't support it, and it all seems to return true.
Is there any way to support these more complex expressions in completionCondition?
I’ll have a look.
I think this #173 might help.
As far as I can see in the BPMN 2.0 spec only expressions are allowed, although a more competent expression parser than the built-in can be used - ergo @aircall/expression-parser
When I use @aircall/expression-parser, and try to start the engine, an error occurs.
<ERR_SMQP_CONSUMER_TAG_CONFLICT> Consumer tag must be unique, _inbound-task_create is occupied
I used the same code as #173 This is my bpmn file: flow.bpmn.zip
Could you tell me what is wrong?
Added a test for your flow that attempts to run through all elements. It runs fine so I'm not sure why smqp complained with ERR_SMQP_CONSUMER_TAG_CONFLICT
in your environment? It even complained on the first task, which is weird?
Do you use @onify/flow-extensions to support camunda related extensions?
Added a test for your flow that attempts to run through all elements. It runs fine so I'm not sure why smqp complained with
ERR_SMQP_CONSUMER_TAG_CONFLICT
in your environment? It even complained on the first task, which is weird?Do you use @onify/flow-extensions to support camunda related extensions?
Thanks for the test case, it's other bugs in my code. Thanks again.
Can I close this issue @eyes4?