In my html task form, a drop-down list of default values is loaded from an html code in Eclipse.
Could anyone guide me a bit please on how can these values be loaded from an h2 database table instead of the html code ?
I would like to add/remove those default values from a relative table in h2 database.
Load the drop down values from a process variable as specified here . You could fill out the process variable with data using a service task before your user task.
Load values from an external rest endpoint that could be connected to your database using the embedded task form and some javascript/jquery/ajax. See this forum post for examples and some github links (refer to answer b).
But having read the relative chapter from Docs here Selects | docs.camunda.org I see that the values of user’s options are pre-configured, like my html code above.
This isn’t what I want as I explained. What I want to achieve is to load the values of user’s options from an h2 table.
Could you please guide me a bit on the way of filling out the process variable with data from the h2 ?
Where must I write the marked script below ?
Note that the Java Delegate example in here does not really explain what is the customerData object. So it makes it a little confusing as to what needs to get serialized and how to do it.
The idea with this Java Delegate is that from here it is possible to fetch data from an h2 database. Personally I am not an h2 SQL query expert, but using some Java code it is possible to fetch data from almost anywhere. From a quick Google search I found this tutorial. Of course, some code logic to parse the data would be necessary.
Next the User Task Embedded form should have the following.