cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Wait Events not working properly

former_member1193316
Participant
0 Kudos

Dear SDNers,

I am facing problem in travel request workflow. I am using both CHANGE, REQUESTAPPROVED and CANCELLED events at wait step.

When request approved by manager, both events REQUESTAPPROVED and CHANGE are triggering at same time. But as per my requirement, when request approved, mail has to be sent to other level approvers and initiator of workflow. And when any change has happened on request, workflow has to complete.

But due to both events triggering at same time, workflow is getting completed with out sending mails to users as change event has been triggered. I also used dummy method to wait for 10 seconds after change event triggered. So that mails shall go to users through REQUESTAPPROVED event, even though luck. attaching below screen shots for reference. Kindly guide me.

First screen shot gives change event path and second screen shot refers the approved event path.

Both events triggered same time, but through change event workflow is coming out from fork.

Please put some light on this issue.

Thanks in Advance,

Regards,

Venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Nath,

It is probably a bit more info required about the business requirements. But why are you using the event REQUESTAPPROVED at all? If the approval of the request is via the workflow only, you just need to implement proper logic after the approval task in the workflow. In the fork, you only need to have 2 branches then (and necessary branches set to 01):

1. for the CHANGE event that would, e.g., complete the current workflow instance or restart the workflow.

2. the actual approval logic with the approval task. Here you can implement the notification to other approvers etc.

Regards,

Shahram

former_member1193316
Participant
0 Kudos

Sorry, first screen shot missed. Please find below

Screen 1:

Screen 2:

Screen 3:

Former Member
0 Kudos

Open the fork step. How many of the branches are required/necessary? If you have two branches (as it seems from the screenshot), then set 2 as required branches. This means that both of the branches of the fork need to be completed before the workflow can complete. I believe this will solve your problem.

The above method can cause another problem though. If in some cases only of the events get triggered, then the workflow will not complete, since it will be waiting for the second branch to get completed, and this might never happen depending on your business process, right? There are multiple different ways to solve this, but let's check first the above mentioned easiest solution.

Kind regards,

Karri

PS. Do not use any dummy steps with ABAP statement WAIT FOR n SECONDS. This is in 99% (or let's say 100%) cases wrong. Use the different workflow step types to achieve different "waiting functionality" (wait for events, wait for conditions, etc.).

Former Member
0 Kudos

You could also separate the logic from the other branch to a completely different workflow. For example if you just need to send some emails after the request has been approved, just create a new event linkage in SWETYPV (for the APPROVED event) and start a new workflow, and send the emails there.

It's really hard to say what is the best approach since I don't know what else is going on in the your workflow and what is the whole idea behind it. Normally it is perhaps best to try to include everything that is related to a same business process into one workflow (with perhaps some sub-workflows), but in some cases you can separate the functionality into separate workflows too.

Regards,

Karri

former_member1193316
Participant
0 Kudos

Dear Karri,

I implemented your mentioned first logic.i.e., i mentioned necessary branches to complete as 02. Even though "CHANGE" event branch is completing and "APPROVED" event branch not completing. Please find below screen shots

I can design another workflow, but i required attachments, approves which are available at this workflow.

Kindly suggest any other clue.

I also mentioned deadline time at wiat step, but no luck

Former Member
0 Kudos

If I understand correctly your screenshot (some critical parts are too unclear), you have fork already in the beginning of the workflow, and then again later. Did you change the necessary branches for the first fork? It looks like the right branch of the first fork gets completed, but now the workflow does not end, since it is still waiting for the second branch to get completed. So something has changed, right?

Are you sure that the workflow does not get into an error? In one of your screenshots (screen 3) I see something red? the graphical log that you are using is actually not the greatest tool for serious problem solving. It looks little bit like the wait for approved event step gets completed, but then something happens, and the green line stops in the first container operation step. Maybe you have an error in the email sending step that follows?

What is the status of the workflow?

Regards,

Karri

anjan_paul
Active Contributor
0 Kudos


Hi,

  What condition  you put into 'HR_APPROVED_FLAG'  step, check and share the screenshot  of  runtime technical log

former_member1193316
Participant
0 Kudos

Dear Karri,

Thanks for the help. Sometimes it is working fine and some times not.

Please find below screen shot now.

.

Regards,

Venkat

anjan_paul
Active Contributor
0 Kudos


Hi,

  Check and compare the runtime  technical  log  of  instance where it is workin and it is not workin

former_member185167
Active Contributor
0 Kudos

Hello,

As Karri says, it looks like you had an error on one of the steps (locked by WF-BATCH). I would look into that.

I think it's a good idea to set a HR_APPROVED_FLAG so you know when an approval has happened. But do you test for it anywhere?

regards

Rick Bakker