How do I create and link external forms to flowable engine

Hello I need help in creating customs forms for my flowable projects…the issue I am having is the know how on the solution of linking these forms to flowable engine. My customs forms could be in json or xml.

1 Like

Hi,

Custom forms are often linked with the user task formKey attribute. You can deploy the form json or xml files in your deployment to let Flowable manage the custom forms and based on the form key retrieve them and show them to the user. But you can also manage the form json or xml in a separate table / database and use the form key as a logical reference.

Best regards,

Tijs

Thanks for the response…But how do I handle the rendering of the form after I add the formId to the form key in the task

It depends a lot on what choice you are making where you are going to store the form json or xml. If you are going for a custom form json or xml then the rendering is something that you would need to implement yourself. If you would use the Flowable form json then we have a form renderer (written in Angular) implemented in the Flowable Task app in version 6.

Best regards,

Tijs

Ok…our choice of storing the form structure for now is the DB and have implemented a service to fetch the structure based on the id. while the the rendering has also been implemented as well. But my question is how do I sync all these to the workflow in flowable, how will I trigger the form rendering from the workflow and pass inputs back to flowable engine. Thanks

Ok. The best implementation strategy that I can think of is to reference the external form with the id value or a logical reference value in the user task form key attribute. Then when you want to present the task form to the user you can get the form key value from the Task instance in Flowable. That allows you to show the correct form to the user. Then when the form is completed, complete the user task and add the form values submitted as variables (the complete(String taskId, Map<String, Object> variables) method on the TaskService).

Best regards,

Tijs

I am starting flowable/all-in-one docker images, Where do I add my custom forms?

When using docker, you don’t have the classpath option. What you can do, is deploy the resources through the deployment rest AP (see /form-repository/deployments)