on 12-20-2011 8:44 AM
Hi guys,
When cancelling a workflow trough : Workflow Definitions -> Current Workflow Processes, it doesn't move the phase of the workflow to a step back. It stays in the "In Approval" phase and can be now modified. You need therefore to move it one step back manually, do the changes and then move it back to "In approval" phase. the logic i am using in the post-script of WF is like this :
if(getApprovalStatus() != APPROVED)
{
home = doc.getIBeanHomeIfc();
home.upgradeToEdit(doc);
try
{
home.changePhase(doc,"Draft");
}
catch(e)
{
logError(e.toString());
}
where "Draft" is a valid Previous Phase, for the "In Approval" phase.
Any help is much appreciated !
Hi Simion,
Add your code removing the if condition in "PreCancelScript" Extended attribute and try . It shall work!.
Regards,
uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uday,
It sounds good, but i don't actually see the "PreCancelScript" option in my workflow editor. The only options available are: Approval Activity, Duration, DurationUnit, LocalizedDescription, LocalizedInstructions, Postscript, Prescript.
I am using WF Editor version 2.1-1.
Can i define maybe a different transition ? Like getApprovalStatus() != PENDING, do i have getApprovalStatus() == CANCELLED ? What are the valid values for getApprovalStatus ?
Thank you
Hi Simion,
You need to right click on the Activity and Then Properties , then go to Extended Attributes tab and create a new element(first icon) with name PreCancelScript and in Value write your code .. Just like you do for PostScript and PreScript.
Coming to second question getApprovalStatus() can check for status Pending , Denied , Approved , Completed only.
For more information :
You can go to following link to get scripting and workflow guide.
https://websmp209.sap-ag.de/support
Go to Release and Upgrade Info->Installation and Upgrade Guide-> SAP Business Suite Application->SAP Sourcing-> SAP Sourcing 7.0/ 5.1 and download scripting and workflow guide.
Regards,
Uday
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.