2016 May 31 1:23 PM
Hi Experts,
in my Incident Management project i have one business scenario where on enabling send to shift supervisor and pressing save button , one workflow will trigger that will send that incident to supervisor where in that one of the workflow step has to change the status of that incident to "in-process"
but in that workflow step its not getting update because that incident is locked in UI .
So is there any way to unlock that incident by coding so i can unlock that incident in that step and update.
2016 Jun 08 10:22 AM
Hi Anjarikam,
one option, you could apply, that you turn the UI to read-only mode after saving and do unlock. After that you can explicitly start your workflow.
Worflows can be started internally such way also , but this require touching the BO.
Actually, no one can ensure you that the workflow engine starts processing immediately, so this problem can happen not only in the case above, but the probability is much less. So if you turn to display mode after save, you'll most probably succseed. Anmyway, there is no reason to keep the incident document ready for input, after it has been assigned to someone else.
Regrards
Attila
2016 Jun 08 2:18 PM
Hello Anjarikram,
the combination of the business object's "Lock Behavior" and the "Transaction Mode" settings determines how BOPF treats locks after SAVE. (I assume that your workflow is triggered after SAVE, right?) In most cases, exclusive locks are not kept by BOPF (except for Lock Behaviors "Dialog Lock" and "Dialog and Update Lock"). They are either released or down-graded to optimistic locks.
(Note also that the BO's settings can be overwritten when the transaction manager is instantiated.)
It also depends on the Transaction Mode whether BOPF (tries to) SET UPDATE TASK LOCAL. Only when the update task has been set to LOCAL, the locks will be released immediately after SAVE. Otherwise the update task may be executed asynchronously, keeping the locks alive a little longer. You might want to SET UPDATE TASK LOCAL right at the beginning of your transaction (at least before any update task gets registered), in order to be on the safe side here.
Kind Regards,
Ivo