Can we have input in the input/output tab without clicking on the plus?


#1

Hello, i am trying to customize the Input/Output tab

And one of my tasks is that i should have already some values there without me clicking on the plus sign that adds inputs.

I know how to create An input or Output that i define, but it only appears after i click on the plus?
How can i make it be there already?

thanks in advance


#2

Having element properties that are added by default is easily possible through using element templates.


#3

This half solved my problem. I was able to find how the input/output elements are added, and basically it comes from ExtensionElement class, in the html property, where you have [data-action], and this is binded to a click event that enters the "set:’ function of ExtensionElement. the binding is done in PropertiesPanel.

Is there a way for me to enter the “set:” function without binding to an event? Like, use a condition in order to access the set every time the condition is true. Where in PropertiesPanel would i have to include it, and how?

Using template element would be a good workaround, but it’s not totally complete.

Mainly bevause it does not support map and list for in/out, and also because when i seem to select a different template, some of the values in the select boxes stay.
Is there anyway to make them disappear every time i select a new template?

I’m sorry for insisting on such small details, but it’s just that my supervisor is very picky about these details.


#4

If you want to add properties by default without using default element templates the properties panel is not the right place to do that. You’d have to modify the ElementFactory to add these properties when an element is created or if you don’t want to touch ElementFactory implement a CommandInterceptor that adds your properties to newly created shapes.


#5

Btw, when using ElementTemplates, i noticed that when i select another template, sometimes the values from the previous template remain in the fields. Is there a way to fix this?
Whenever i choose a new element template, i would like the values from the old template to not be present.


#6

This is desired behavior. If you apply an element template to an element the respective properties are set on the element. If you apply another element template to the element all previously set properties that are not overridden will remain unchanged.


#7

This is strange, because i saw in the code for ChangeElementTemplateHandler that oldMappings and OldProperties are being removed by the cmd. (This is inside the Camunda provider, so i’m not sure if this is the right place to ask this).
I’m not sure, maybe i understood the code wrong.
And since you said it was done on purpose to keep old properties, is there a way i can change this?


#8

Alright, so yes. I noticed that when i use “camunda:property” in the ElementTemplates details, then old fields are removed. Thank you for the help though.