We are using templates for our bpmn-js service tasks with the effect that the default Input/Output Groups are removed after selecting a template for a service task. Due to the fact that we need them my approach was to create a custom provider for my own input and output groups, strictly following the properties-panel-list-extension.
Everything worked pretty fine and I was able to create multiple Input/Output entries in the groups but there was a problem: In the created export they were exported to xml as input:parameters for the group and input:parameter for the group- entries. But I need the same naming as the standard Input-Output Groups. They are exported by default as:
That is exactly what I need for my custom provider. My first try was to make my ‘input.json’ file to export it the way described above, but due to the fact that the camunda prefix is already in use this is not possible.
So I tried to use the exiting camunda.json file only, but clicking on the + icon to create a new value has no effect. It seems that the element for the values is not create for some reason. Making a console log for the created element showed me this:
while the created element for the default input/output (which is working but with wrong xml export) group looks like this:
You do realize that there is an values array that is missing on previous image and I am not able to find a reason or solution for this issue.
I hope someone can help us out and give us advice how to export Input/Output for our custom provider as camunda Input/Output. Thank you very much in advance.
Please share a running / prototypical example that clearly shows what you’re trying to achieve, what is working and what is not.
Use our existing starter projects to quickly hack it or share your existing, partial solution on GitHub or via a CodeSandbox. Provide the necessary pointers that allow us to quickly understand where you got stuck.
This way we may be able to help you in a constructive manner.
So my first approach was to modify the input.json to match the required output. But this was not possible because the prefix ‘camunda’ cannot be defined in multiple json descritors.
In the second sandbox you can see the approach to modify src/customPropertiesProvider/input/utils.js and src/customPropertiesProvider/input/parts/ParametersProps.js using the default camunda.json descriptor to directly create camunda:InputOutput and camunda:InputParameter elemets, but running into some problems, as described in my previous.
I hope this helps to understand what I am trying to achieve and the problems I ran into. Thank you in advance
Also, if you want to use camunda namespace, there is no need for input.json moddle extension. Just use the types from camunda-bpmn-moddle and that extension.
This is because extension.get("values") returns undefined which cannot be iterated via .... Since you want to add inputParameters, a change in the code to retrieve inputParameters should help:
Hello @barmac, thank you very much for your answer and your help. I now had the opportunity to test the solution and noticed the following: You can only create an input parameter via the + symbol if a name-value pair of the type ‘camunda:inputParameter’ is already present in the template.json. And then two input elements are created, one with the name/label according to the template.json file and one with a randomly generated name. I had hoped that it would also be possible to create input elements if they are not yet part of the template, as in not present in the template.json, and that the behavior would rather correspond to that of the standard input/output elements. It would be very nice if you could help me with this again.