cancel
Showing results for 
Search instead for 
Did you mean: 

Cancelling a workflow doesn't move a phase back

Former Member
0 Kudos

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 !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Simion,

Add your code removing the if condition in "PreCancelScript" Extended attribute and try . It shall work!.

Regards,

uday

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Uday,

Thank you for your hints. It really helped me !

All the best,

Simion

Answers (0)