Displaying multiple forms for a user task

Hi,

In our process at most of the user tasks, we need to display data collected during previous tasks of the process.

I would like to do the following:

  1. have one form that deals with only the data to be accepted in that specific user task (typically a small form with a couple of fields). This form always needs to be displayed first

  2. have another form that contains/shows all of the data collected so far (this will be a huge form with many fields)

However, it seems to me that in Camunda, only one form can be configured for a certain user task (a single form-key).

This forces me to create a dedicated form for each and every user task by copying-and-pasting a LOT of form fields from other forms (which is a maintainability nightmare).

How can this be solved without massive form-code duplications and maintainability issues?

I thought of integrating all of the process fields into a single form (a section for each data group) and dynamically hide sections it with process variables but that doesn’t sound very elegant.

Hello there,

Can you please tell us where you are configuring your forms and where are these forms designed ?

Are you using the default camunda forms and setting the form in the modeler? Or you using a third party form designer ?

@maroun_ayle Thanks for your answer.

I am designing the embedded forms in a simple text/html editor (IntelliJ IDEA in this case). Not using any kind of visual designer.

I am setting the form-key of the user task in the Camunda Modeller desktop app (Linux version). (I can edit the XML directly if necessary but I use the Modeller for setting many development/execution related attributes after I get it from the business analyst. I will need to continue to make changes on it with the Modeller after I set the form-key for a task)

I am deploying the forms together with the bpmn diagram into the Camunda instance (with the Camunda Modeller during development, probably the REST API in production via the CI/CD pipeline)

If there is some include mechanism in the forms, that could also help (AngularJS or a Camunda-specific mechanism).

(I didn’t see any such mechanism in the docs but maybe just looked at the wrong places)

If you have access to the java code, one way to do things is to store your forms anywhere you like, bind the form key to where you stored your form and return the form data when you’re returning the task.
This way you can be efficient with your forms and not worry much about re-writing stuff all over again.

I am embedding the Camunda engine into a Spring Boot application but we would like to use the Camunda Tasklist as the primary UI.

I am not sure I properly understand your recommendation.

Do you recommend that:

  • in the BPMN definition, I use a custom form key format (say: embedded:my-app:)
  • the “my-app” binding should dynamically compose the form definition on the server-side?

If so, how do I bind the “my-app” keyword to a form resolving mechanism in the Spring Boot app?

I thought you were gonna render the form on an independent app and not in the camunda modeler. This is why I recommended you use the form key field to bind it to another form-id, in the UI you are rendering your forms in.

Nope, we are currently using the Tasklist app with embedded HTML forms.

Any solution in this context?