Visibility condition not properly working for people form field and possible related data loss
Using a visibility condition on a people field can lead to loss of previously entered data, as APS sets the value of the people field to null when the field is not visible and related task is completed.
Steps to reproduce
1. Login to activiti-app as email@example.com
2. Via "App Designer" -> "Apps" import the attached app "PeopleVisibilityDefect.zip"
a) The app comes with a simple process: start event -> user task A -> user task B -> end event
b) Both tasks have a form referenced. Task A allows to set a people field and a text field and Task B allows to set the same whereas they both can be hidden using a radio button and visibility condition
3. Publish the app
4. From the published app on the landing page, start a new process
5. In Task A, set the Administrator for the peopleDefect people field and fill the field textField with the value "Administrator" and complete the task
6. In another browser tab, use activiti-admin and inspect the variables set for the started process instance and note that both, textField and peopleDefect have the values as set.
7. Back in activiti-app and Task B, just set the hide radio button that will hide the two previously filled fields based on a visibility condition and then complete the task
7. Back in activiti-admin, inspect the variables once more for the completed instance
As we did not change the values of the fields, the actual related variable values remain untouched:
The variable textField is of type String and set to "Administrator" still.
The variable peopleDefect is of type Long and set to 1 (default user ID for the Administrator user).
There is inconsistent behaviour and the peopleDefect variabel is reset although not being touched:
The variable textField is of type String and set to "Administrator" still. (Correct behaviour)
The variable peopleDefect is of type null and set to a value of null. (Incorrect behaviour)
Reproduced in current latest APS 1.11.2 release