Hi,
I am trying to follow User Task Forms | docs.camunda.org in order to be able to read the parameters which was submitted via form field. The link above says something about form field key, but I can’t find such value in modeller…
When no variable exists with the same name as the form field key, then a new process variable will be created and gets the value from the submission.
So how can I have submitted value be accessable as process var?
You can either define a form key that links to a form or you can use the form fields, where you can directly create variables in the modeler. Those will be displayed in tasklist at the user task and if a user completes the process those become process variables.
Hi @Nele , thanks for your response.
Does it also apply for API? In other words, by submitting the form field programatically (via submitTaskForm method) will process variables be added as well?
yes this also applies for the API. So if you use complete or submit-form method you also add the variables to the process unless you mark them as local.
Ok, so something wrong with my setup…
Let me describe the steps I performed:
create a user task with form field called data (of type string), no formkez specified
no input/output params were added
API’s submitTaskForm method is called
Expected: processes variable called data is created and can be used in expression within gateway element (in bpmn)
Actual: no variable called data created, no way of using user input as expression.
Is this assumption correct or did I miss something?
I just reproduced it and it works for me. I used the following model example-submitt-task-form.bpmn (4.4 KB)
I started the instance and used a REST Call to submit the form and it works and the instances is routed based on my input from the API call.
Can you maybe share more information on your case? Maybe the model itself or the API call you are doing?
Mh, ok, thanks for your example.
One thing I think I did wrong, I used ${data==..} instead of #{data==..}.
But even after fixing it, I still have no proper routing… just to make sure, did you use FormService (Camunda Platform Javadocs 7.15.1-ee) in your example @Nele ? Maybe java impl somehow different than REST API?