camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.49k stars 478 forks source link

`defaultValue` not working when used in Camunda Platform < 7.16.5 #3002

Open rondie opened 2 years ago

rondie commented 2 years ago

Describe the bug

A select element in a form has an option to select one of the values as its default (defaultValue). When using this on Camunda Platform versions < 7.16.5, the default value does not show up when viewing the form.

image

This is because defaultValue was only introduced via form-js@0.6.0, which was embedded earliest in Camunda Platform 7.16.5. I got no warning on the form editor while configuring my form.

Also can't find it referenced on https://github.com/bpmn-io/form-js/blob/master/docs/FORM_SCHEMA.md, but I suspect it does not contain all possibilities.

Steps to reproduce

Make a form a select element, enter some values and set one as it's default. It does not show up as default value after deployment (tested on camunda platform 7.16)

Expected behavior

Got a warning in the Modeler that defaultValue is not supported in < 7.16.5. Note that would also need the Modeler do distinguish between patch versions of an execution platform.

Environment

OS: MacOS 12.0.1 Camunda Modeler Version: 5.0.0 Execution Platform: Camunda Platform 7.16.0 Installed plug-ins: none

Additional context

No response

pinussilvestrus commented 2 years ago

Hi @rondie, thanks for sharing, and sorry for responding so late!

I was not able to reproduce this, are you able to share your .form file and the BPMN process you are running to display the form?

Adding the defaultValue to the FORM_SCHEMA would definitely make sense though. 👍

Thanks!

rondie commented 2 years ago

Hi @pinussilvestrus,

No problem for the delay in response, this is not a breaking issue.

Attached is a very simple diagram and form I made (no real world stuff). defaultValue is set through modeler GUI to Default Value one, and does not show up for me as selected when starting this process. Let me know if you need any more info.

process.zip

pinussilvestrus commented 2 years ago

Thanks for sharing! I can reproduce the issue when deploying your shared files on Camunda Platform7.16.0 (Run)

image

However it does not appear when I upgrade to the latest version of 7.16 (e.g. 7.16.9) or 7.17

image

So it seems to be fixed in the meanwhile (I can't find the exact release note yet). Did you consider upgrading to fix your problem?

rondie commented 2 years ago

That would fix this for me, and I will make sure we upgrade to Camunda Platform 7.17.

As long as Camunda Modeler allows versions 7.15 and 7.16 to be chosen, this bug will ofcourse remain.

pinussilvestrus commented 2 years ago

I just double-checked with @marstamm and indeed defaultValue was introduced only in form-js@0.6.0, which was integrated via Camunda Platform 7.16.5, so it does not work beforehand.

A good indication for the need form linting on properties level (/cc @christian-konrad). The editor should indicate that certain properties are not supported in selected versions. I will update the issue accordingly.