cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Form creation (URGENT)

sarkar92
Champ in-the-making
Champ in-the-making
I am using activiti 5.14.
I am using REST api to start process , viewing usertask and complete task.
I have almost 10 processes in my project. In every process there is "fixed" form in usertask and that form hold some non-editable value.
While showing usertask values in using those form values.

But now the problem is as our project processes growing i need  "generic form" for all process instead of fixed form in every user task.
Is it possible whenever i start a process using REST i pass some values to that process and using those values i will dynamically create a form for usertask.


thanks
5 REPLIES 5

sarkar92
Champ in-the-making
Champ in-the-making
I forget to add that in my process there are only script tasks…. no Java Service tasks

frederikherema1
Star Contributor
Star Contributor
You are referring to the form-properties I presume? It's currently not possible to define a "shared" set of form-properties for multiple user-tasks. Are you using a custom UI to show the forms? If so, you can opt for NOT using the form-properties but count on the "form key" instead, creating a form in your UI and passing in variables when submitting the form, instead of using form-properties.

This way, the way the form is rendered is completely up to you, so it can be dynamic/shared with other user-taks, while the process is unaware of this, and is just receiving variables.

m_koohi_m
Champ in-the-making
Champ in-the-making
How we can count on "Form key" ?  I make an HTML or JSF file and use "form key" to reference this file to my process. But I don't really know, how can make a connection between my process and that HTML or JSF file when I deploy the process. I mean the process file in Activiti 5.14 just a bpmn file and can not make a BAR or ZIP file with other resources.

How I can add these resources to my process? (I thought, I should add these resources to the Activiti Tomocat! Maybe!)

Best,

frederikherema1
Star Contributor
Star Contributor
The UI is really dependant of the engine itself. You should create your own mapping between the form-key of a task and *SOME* view you will render in the UI-tier. Depending on what UI you're using, your view-manager will have to either redirect to that particular view or include a fragment of HTML/whatever in the current view, based on that key.

harivardhan
Champ in-the-making
Champ in-the-making
can you please provide some example code for this? It will help a lot.