Troubleshooting: Error:Assign Mismatch" when a Before This Action activity transfers a work object
A developer asks: We have an application that sometimes requires that a work object is reassigned to the current operator after it is updated by him. These work objects are often selected from a workbasket.
Our application was configured to update the assignment related to this work object in the Before this action activity of many local flow actions. These activities start when the user selects the associated action in the action drop-down list. Note that this means the activity run without the user clicking Submit on any of the forms.
This is causing many assignment errors to appear in the workbaskets where the object was originally assigned. The instructions become:
Error: Assign Mismatch
We are using the Work-.Reassign activity. This activity attempts to remove the work basket assignment (using the Obj-Delete method on the Assign-WorkBasket object) and create a new worklist assignment (Obj-Save method on the Assign-Worklist object).
Relationships between assignments and work objects are bidirectional. The assignment holds a reference to the work object. The work object holds references to all existing assignments (under the .pxFlow
Updates to assignments from the Before this action activity of a flow action are unwise. In the case of the scenario described, the assignment updates were being rolled back at this point. The problem is that the updates to the work object were not being rolled back, resulting in the data inconsistency and the Error: Assign Mismatch message.
Do not reassign the work object before a user has performed any action on it. Defer updates to assignments until after the actions have been performed by the user, . as part of the After this action activity call. That way, the updates are fired when the user submits the local flow actions.
To address your business requirements, move the reassignment of the work objects to the After this action activity. All transfers of assignments will occur correctly and no assignment errors will occur .