Posted: 8 May 2017 22:17 EDT Last activity: 10 May 2017 1:38 EDT
How to reopen a work object
I need to build a reopen functionality. The out-of-the-box reopen does not meet our requirement (I will skip explanation why) and I am building it as workflow manually. I just found out ChangeStage is actually enough to reopen work object and PRPC seems to handle some properties related to reopen such as PYREOPENCOUNT (and other resolution related properties). My question is, is it okay NOT to use process API called "reopenWorkObject" (this seems to be a standard and important activity) but just only ChangeStage? (The reason I am avoiding to use reopenWorkObject is, if I use it, it creates an unnecessary reopen assignment after stage is changed and it didn't get deleted by itself).
If you invoke the Reopen activity in Work- it will take care of reopening the workobject and also the OOTB reopen flow(pyReopenToStage) shows up an assignment to choose which Stage you want to re-enter to.
pyReopenToStage is a process that is available and this shows the option of going back to the last stage or choosing another stage. In your case this can also be overidden and move to any stage based on the need.
You should stick to using API rather than invoking Change stage yourself. And as far as unnecessary reopen assignment s considered, you can customize the above mentioned process to automatically change to a particular stage rather than having an assignment to present that option to end users.
Ok, it seems I need to explain about the whole thing. I understand all stated above, and after my analysis, I was taking my approach. So, the reason why I can't use out-of-the-box Reopen mechanism is, it reopens immediately (status becomes "Open" right away) and flow (pyReopenStage) starts (in this flow action you can select last stage or arbitrary stage you name). However we shouldn't let this work status change happen until approver approves. We need to have routing mechanism and only after approval is finished, the work object status should be changed. This is a hard requirement from audit standpoint. Overriding pyReopenStage to have routing assignment shape does not help because reopen occurs anyways before this flow even starts.
So, if you look at pyCaseTools section, instead of using out-of-the-box action "Re-Open Work Item", I am having to manually start my custom flow without changing anything like status on work object but simply opens up an assignment to select whom to assign. Then this work object is routed and if approved, I need to reopen manually and change stage. I tried using Work-.Reopen or Work-.reopenWorkObject API but this additional assignment issue happened (Please see screenshot attached - everything is explained here). That is why I am now using only ChangeStage and everything seems to be working fine. Only exception is it was not getting "Item Reopened" audit so I added it myself at ChangeStage to say "Reopen operation is completed". I understand it is safer to use these API but if I really need to, then how can I remove this "additional" assignment? Please look at my code and let me know how.