Hi,
Many of the java Form Engine API’s seem geared towards a single instance of a form per task (like completeTaskWithForm). I guess this makes sense in that variables may clash if you were to store them on the process engine, but what if the form data was rather stored as objects in themselves through which data can be reference?
It seems to me to at least be theoretically possible to store multiple instances associated with a task in the database. So if I had 2 instances of form x for one task I would have something like this in the database:
act_fo_form_resource
id_ | resource_bytes_
--------------------------------------+------------------------------
ef3934f3-6650-11e7-8866-024264d65c63 | {"values":{"var1":"hello"}}
e91ca7d1-42c1-11e7-872a-02420b015a3f | {"values":{"var1":"bye"}}
act_fo_form_instance
id_ | form_definition_id_ | task_id_ | form_values_id_
--------------------------------------+--------------------------------------+----------+--------------------------------------
ef398314-6650-11e7-8866-024264d65c63 | cf036bb3-64b7-11e7-bc13-024264d65c63 | 174 | ef3934f3-6650-11e7-8866-024264d65c63
e91ccee2-42c1-11e7-872a-02420b015a3f | cf036bb3-64b7-11e7-bc13-024264d65c63 | 174 | e91ca7d1-42c1-11e7-872a-02420b015a3f
Task 174 having multiple instances of form definition cf036bb3-64b7-11e7-bc13-024264d65c63.
Is this an acceptable approach? I don’t want to stray too far from the intention of the authors here.
I have a use case where someone loads up a CSV file, that contains multiple instances of a form, which a user then gets back as a form to review and edit. While I could use form_key and roll my own forms, I want to see how much mileage I can get out of the form engine.
Another option is to have multiple task instances each with their own form instances, but from a modelling perspective this makes me uneasy and generates extra overhead.
Any comments? Ideas?