Form properties & variables in multi-instance loops

Say you have a userTask with multiInstanceLoopCharacteristics to gather feedback from 5 different users, with a single form field. It’s not obvious to me how you can build a list of form values here, other than hacky ideas like tacking the assignee onto the formProperty id. The naive approach is a single id that is overwritten by every user.

What’s the best approach to handling inputs with multiInstanceLoopCharacteristics?

Hi,

You are right that this is a bit of a challenge with multi instance constructs. By using execution local variables you can store each variable separately on the multi instance execution. But at some point you will need logic to merge the variables to a list on the process instance execution to be able to use the variable values at a later point in the process instance. You could also use the HistoricVariableInstance to get the values of each multi instance execution when needed, but that could cause performance issues when there’s a lot of data in the history tables.

Best regards,

Tijs

I think I’d need to see a code/BPMN sample of the first approach to understand.

I’ve tried looking at HistoricVariableInstance but it does not seem to return values at all for form values when querying an execution ID, and only returns the final value when querying all values. The only way I see per-instance values is with a historic detail query as you suggested in my other post.

Ok, you are using form properties, not the new form JSON definitions?
For form properties historic detail query is the best approach.

Best regards,

Tijs

Yes, I’m using form properties.

What is the role of the JSON form definitions compared to defining form properties in BPMN? Is it meant to replace that, or complement somehow?

Hi,

The JSON form definitions are the way forward for using forms in Flowable 6. There’s now a Form builder that allows you to create the JSON form definitions in a drag and drop way and there’s an Angular form renderer to render the start or task form. It’s a lot more flexible than the form properties approach and it cleanly separates the forms from the process definition.

Best regards,

Tijs