cancel
Showing results for 
Search instead for 
Did you mean: 

Solution for Typical Business scenarios in PO workflow

Sumankalyan17
Participant
0 Kudos

Hi all,

I have built a custom PO  release workflow  for event BUS2012 ReleaseStepCreated  but we have got some business scenarios and we don't know how to handle them.

I know the below question would have been asked a lot in the forum but i am not getting appropriate answers.

1.Workflow is created whenever release strategy is created and the event is triggered.So when a PO is created a workflow is created.

  But when the same PO is changed and for some reason the release strategy is triggered again ,then a new workflow is triggered again.

So how to logically delete or remove,or complete the previously created workflow .

2 . After approval  of work item  at user decision,  i am calling BUS2012 Release method in  a task .But if the release fails due to any reason(for eg ,the PO is in edit mode by another user),then the entire workflow goes into error.

We can ask the initiator to restart the workflow from SWPR but how to notify the initiator in case of error.

We dont have a workflow admin on the client side :(.

Any advice would be very helpful.

Regards

Suman.

Accepted Solutions (1)

Accepted Solutions (1)

Sumankalyan17
Participant
0 Kudos

The issue has been fixed.

PFB the solution.

Writing the event is Version dependent part in Workflow will not work because the same event will get triggered when User rejects the PO release.

So I had to create in the workflow to check for SignificantlyChanged event in one branch and the remaining workflow process in the other branch.

In the waiting branch , I am checking if no action taken by user ,then cancel workflow,

else wait for a local event.

I am raising a local event after all the steps are complete in the other branch..

Hope I am clear in explaining the solution.

Regards

Suman

Answers (5)

Answers (5)

Sumankalyan17
Participant
0 Kudos

Hi,

After doing the suggested changes the workflow is getting cancelled whenever the event Significantly changed gets triggered and the workflow gets cancelled

But now a new issue has cropped up.

Whenever the work item is approved or rejected ,then the event gets triggered ,and the workflow gets logically deleted.

Kindly advise,

Regards

Suman.

Sumankalyan17
Participant
0 Kudos

Hi

The solution to maintaining events at version dependent in workflow version is not working.

The old PO workitem is not getting deleted even when the PO is changed.

Do we need to do any other settings apart from maintaining the events?

Attached the snapshot for workflow.

Kindly advise if I have missed anything.

Regards

Suman.

anasabdulla
Participant
0 Kudos

Hi,

Check in SWEL whether SIGNIFICANTLYCHANGED  is triggered. When you change PO, it can trigger either CHANGED event or SIGNIFICANTLYCHANGED  based on the configuration.

Thanks,

Anas Abdulla.

Sumankalyan17
Participant
0 Kudos

Hi Former Member,

yes i put a trace ,checked it. Whenever I am  changging the amount to trigger the release strategy then first SignificantlyChanged event is triggered and then ReleaseStepCreated event is triggered.

One more thing when i am creating the event mapping as per snapshot I am getting the warning Local event <event name > not used.

Any idea what needs to be done?

Regards

Suman.

rajeevgoswami1
Participant
0 Kudos

For point 2 you either not allow user to change the PO once release workflow is triggered and completed or you can return a flag in your task method in any error occur while approving, based on that flag you can send a mail to notify initiator.

Thanks,

Rajeev Goswami

Sumankalyan17
Participant
0 Kudos

Once the task gets an error,the entire workflow goes into error,so cannot send a  mail to initiator.

Regards

Suman.

anjan_paul
Active Contributor
0 Kudos

Hi,

  Did you maintain the Terminating event with proper binding with SIGNIFICANTLYCHANGED  event of Release of Purchase order step task. Then whevenever Significantly change happend, old workitem will  deleted from inbox of agent

Sumankalyan17
Participant
0 Kudos

Hi ,

Thanks your reply.

If I maintain Significantly Changed as the Terminating Event in the user decison ,then will thesued decision will be terminated or the entire workflow will be deleted.

Then will it not affect the new workflow that gets triggered on PO Change?

Regards

Suman

anjan_paul
Active Contributor
0 Kudos

Hi,

   Workflow will complete or not depends on the design. If there is no further foreground step, then it will complete like in WS20000075.

   If  you do it other way, then go to basic data - >Version Dependant -> Events.  Maintain the  SIGNIFICANTLYCHANGED event there and  select    Cancel Workflow in  Receiver Tyep.  Then directly workflow  will cancel

Sumankalyan17
Participant
0 Kudos

Hi Anjan,

I have further background steps after the task .

Also one quick question.

If we maintain the event as suggested by you ,will it delete the older workflow.

For eg. If I create a PO the workflow gets triggered.

If i change the workflow then significantly changed event will be triggered ,which in turn will trigger the ReleaseStepCreated event and a new workflow will start.

So if I maintain the settings as suggested how would the workflow know to delete the old workflow and not the new one ?

Regards

Suman

anasabdulla
Participant
0 Kudos

Hi Suman,

As u said, Significanlty Changed event will be triggered 1st & then  ReleaseStepCreated.

1. Significanlty Changed event triggered ->Complete the old workflow

2. ReleaseStepCreated ->Start new workflow

Thanks,

Anas

anasabdulla
Participant
0 Kudos

Hi,

Does your Custom workflow has 2 start events? (ReleaseStepCreated & Changed).

If not, i think when you change the PO, Significantly changed event is triggered which inturn triggers ReleaseStepCreated. So according to me, keep a wait step for 'Significantly Changed'. This will complete the existing instance of the workflow.

Check SWEL and get to know about the events triggered while creating, changing the PO.

Thanks,

Anas

Sumankalyan17
Participant
0 Kudos

Hi Former Member,

My workflow has only ReleaseStepCreated event as the start event.

The SWE2 setting is copied from the customisation maintained for WS20000075 workflow for BUS2012.

If i do the above change then how will it behave when the PO is created?

Regards

Suman