Together with my current consulting customer, I tried to come up an element template for the following example:
The Element Template should:
- only apply to Throwing Signal Events
- add a Signal with the name ‘SubscribeToThisSignalAndDie’ without showing it
- add a predefined ExecutionListener without showing it
- hide the original Signal and Signal Name properties
- add a camunda:property with the name ‘signalName’ and a value defined by the user
Except for number 5, all other requirements seem hard if not impossible to realize with the current mechanism.
Here is the XML that we want to produce:
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_0f68r99" name="waiting canceled">
<bpmn:extensionElements>
<camunda:executionListener class="com.camunda.bpm.demo.signal_event_interrupts_parallel_branch.SendSignalToParallelBranchExecutionLister" event="start" />
<camunda:properties>
<camunda:property name="signalName" value="waitingCanceled" />
</camunda:properties>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_0dlumc1</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1c84drg</bpmn:outgoing>
<bpmn:signalEventDefinition signalRef="Signal_12lmyze" />
</bpmn:intermediateThrowEvent>
<bpmn:signal id="Signal_12lmyze" name="SubscribeToThisSignalAndDie" />
And here is how we imagined the JSON:
[
{
"name": "Signal to Parallel Branch within same Process Instance",
"id": "com.camunda.example.SignalToParallelBranch",
"appliesTo": [
"bpmn:intermediateThrowEvent[bpmn:signalEventDefinition]", // we tried to write it in XPath notation
"bpmn:endEvent[?(@.bpmn:signalEventDefinition)]" // or how about JSONPath
],
"properties": [
{
"type": "Hidden",
"binding": {
"type": "bpmn:signal",
"name": "SubscribeToThisSignalAndDie"
}
},
{
"type": "Hidden",
"value": "com.camunda.bpm.demo.signal_event_interrupts_parallel_branch.SendSignalToParallelBranchExecutionLister",
"binding": {
"type": "camunda:executionListener",
"event": "start",
"isClass": true
}
},
{
"label": "Signal Name",
"type": "String",
"binding": {
"type": "camunda:property",
"name": "signalName"
},
"constraints": {
"notEmpty": true
}
}
],
"entriesVisible": {
"_all": true,
"signal": false, // how does one find these ids?
"signal-element-name": false // not even looking in the code seems to help: https://github.com/bpmn-io/bpmn-js-properties-panel/blob/5a03df94f59cc8642bd2af404382b4e8115df968/lib/provider/bpmn/parts/implementation/SignalEventDefinition.js
}
}
]
Could you please give us some feedback, if something like this is possible today or in future.