I am having trouble getting my head around what actually happens with each instance of an infopath form in a process, and the what instances of a form are created within a process. I would appreciate any assistance in working this out.
Firstly, I am using an infopath form within a process to collect information.
Am I correct in my understanding that the following occurs:
There is an instance of the form held within the PROCESS (the ProcessInstance)
When an activity is created, then another instance (ActivityDestinationInstance) of the form is created, and used within this activity.
When the activity completes, then the ActivityDestinationInstance is copied from the activity, and overwrites the ProcessInstance.
Based on this, could someone give me an idea of the best way to approach the following problem:
The infopath form that I have can be sent to multiple destination users. Each destination user can select a status, and add comments. I would like to add the status and comments to a repeating table in the infopath form (using code in K2), so that a full history can be viewed on the form at any stage.
If I alter the ActivityDestinationInstance version of the form using K2 code to add the coments and status selected, and there are multiple destination users, won't the forms that are completed last keep overwriting the data from the previous destination users?
eg 2 destination users for the activity, user A and user B. Planning for the activity is "Plan Per Destination" "All At Once", so each destination user should receive the task at the same time, and there is a slot for each destination.
The activity is started. A Task is assigned to User A and user B (this also creates a separate instance of the form for each user)
user A completes the form, and selects "Approved" and adds comments. When A completes the task, I have some server code that runs to add the status and any comments to a repeating table in the ActivityDestinationInstance version of the form.
User B then completes their task, and selects "Changes Required". The server code runs again to add the history to the ActivityDestinationInstance version of the form.
Which instance of the form will then be copied back into the ProcessInstance of the form? Does User B's form become the version that is put back into the ProcessInstance?
If so, what is the best approach that allows me to preserve the history from both destination users?
Hopefully this is clear enough (my head certainly isn't). If you need any further information, please let me know. I would really appreciate someone helping me to clear this up.
Thanks in advance!!
ActivityDestinationInstance Query...
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.