Add ability to create `optional` inputs & outputs via cloud element templates
See original GitHub issueIs your feature request related to a problem? Please describe
The way element templates work is that properties are persisted in the XML in all cases, although they could be empty (cf. https://github.com/bpmn-io/bpmn-js-properties-panel/issues/501). For the newly added element templates support (cf. https://github.com/bpmn-io/bpmn-js-properties-panel/issues/540) for zeebe:input
& zeebe:output
I want to prevent having empty parameters, to ensure they don’t have effects on the execution engine.
Describe the solution you’d like
Add the possibility to mark a zeebe:input
or zeebe:output
property as optional. E.g.
[
{
"name": "REST Connector",
"id": "io.camunda.connectors.RestConnector-s1",
"description": "A generic REST service.",
"appliesTo": [ "bpmn:ServiceTask" ],
"properties": [
{
"label": "Request Body",
"value": "",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:input",
"name": "body"
}
},
{
"label": "Result Variable",
"value": "response",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:output",
"source": "= body"
}
}
]
}
]
When the input field is then configured as empty, it should not persist in the resulting XML. We have to make sure it works alongside existing template configurations (or permit them via JSON Schema)
optional = true
andvalue != null
(default value is defined, what happens after I deleted the value via UI?)optional = true
andconstraints.notEmpty = true
optional = true
andeditable = false
Describe alternatives you’ve considered
We have something similar in Camunda Platform (C7) for output parameters, where we handled this via toggle switch. This doesn’t work in a generic fashion though / with simple custom fields.
Additional context
Related to #501 Related to #540
Child of https://github.com/camunda/camunda-modeler/issues/2640
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
What I would expect here is 1 - Define an element templates with a
zeebe:input
, optional = true and value = ‘foo’ (default value) 2 - Apply element template --> input parameter gets created with source = ‘foo’, UI shows ‘foo’ as value 3 - User removes value in UI --> input parameter gets removed from XML (empty value) 4 - UI does not show the defined default value on empty (as it is now), but leave it emptyAgreed. ✅ Optional properties like
zeebe:Input
must not be added unless they’re supposed to be present in the XML. We always lint a BPMN diagram as-is, meaning we lint what would be exported at that point in time.