question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to create `optional` inputs & outputs via cloud element templates

See original GitHub issue

Is 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 and value != null (default value is defined, what happens after I deleted the value via UI?)
  • optional = true and constraints.notEmpty = true
  • optional = true and editable = 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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
pinussilvestruscommented, Jan 25, 2022

optional = true and value != null (default value is defined, what happens after I deleted the value via UI?)

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 empty

1reaction
philippfrommecommented, Jan 30, 2022

Agreed. ✅ 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learn template basics - AWS CloudFormation
Learn the template basics of using resources, parameters, and other components of templates and how they work together.
Read more >
Google-provided utility templates | Cloud Dataflow
(Optional) The field delimiter used by the input CSV files. outputFilePrefix, (Optional) The output file prefix. The default value is output . numShards,...
Read more >
Create custom forms - Power Automate
Property name Optional Accepts Default Allow multiple selection N/A Boolean value False Alternative text Yes Text value Background color Yes Text value
Read more >
User input in vRealize Automation requests
As a cloud template designer, you use input parameters so that users can make custom selections at request time.
Read more >
Cisco DNA Center User Guide, Release 2.1.2
You can design templates easily with a predefined configuration by using parameterized elements or variables. After creating a template, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found