Hi Experts,
I have a requirement to move document's phase to 'Endorsed' and lock the document when all endorsers endorse the document in the workflow. I put below script which is to move the phase and lock the document in the postscript of the End Of Approval stage. So i tested it and found that the phase was moved to 'Endorsed',but the doument did not get locked. It seems that the document was locked in the postscript,but when the document went out from the workflow the workflow engine released the lock automactically. Is there another way to implement on this requirement?
---------------------------------------------------------------------------------------------------------------------------------------------
if (getApprovalStatus() == APPROVED)
{
home = doc.getIBeanHomeIfc();
if(doc.getCurrentPhase() == null || !doc.getCurrentPhase().getDisplayName(session).equals("Endorsed")){
home.upgradeToEdit(doc);
try
{
home.changePhase(doc,"Endorsed");
IapiDocumentLockManager.lockDocument(session, doc);
}
catch(e)
{
logMsg.setLogMessage(e.toString());
logMsg.setException(e);
Logger.error(logMsg);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance
Noppong Jinbunluphol