Declare Trigger - Committed Delete on Assign- class not working consistently
I need to do a Processing when an Assignment instance is deleted from DB.
I created Declare Trigger rule in Assign- Class ->Committed Delete ->When condition(.pxRefObjectKey contains "<work class name>") -> Declare trigger Activity has logic on updating the corresponding Work case by referring newAssignPage and newAssign Page has keys pointing to pzinskey of the Work Class.
My Question is After Delete Commit of the Assignment instance..do the newAssign Page on Clipboard always exists even if the Assignment instance is deleted from the Data base?
If newAssign Page gets deleted from the clipboard if the Assignment instance is deleted from the Data base,then how can I do the processing of the corresponding Work Case whose pzinskey can only be referenced from the newAssign Page? Please let me know
I think this is one of those situations where you're best off running Tracer and seeing what you find. From what you said above, if it works sometimes but not every time, perhaps there is a race condition in play?
I would not expect this to work differently for assignments than other classes. So you could try a controlled experiment where you define your own class and a declarative, and see whether the instance of your class that you just deleted is available to the declarative target activity.
On a higher level, you may want to think about what you are trying to do, and whether a declarative on assignment-deletion is really the way to go. It sounds like the sort of thing that could break. For example, if Pega currently always deletes the assignment when the flow progresses, you might be ok, but suppose in the future Pega decides to be more efficient and modify the assignment object as the flow progresses rather than deleting it. Suddenly your declarative won't fire anymore.