cancel
Showing results for 
Search instead for 
Did you mean: 

How to complete sub workflow within main workflow or event?

former_member185540
Active Participant
0 Kudos

Hi guys,

I have a workflow with a fork which has three lines. two lines are normal however the third one is calls a sub workflow. My condition is that complete all three and proceed or one container ie URGENT = X then proceed.

The issue is that when container URGENT = X the workflow still waits on the line for the sub workflow. This is because the sub-workflow is not completed but in this case i want to complete it automatically so that i can proceed.

How can I do this? I have tried to raise an event but its now working, is there any other way?  may be i am raising the event in the wrong way, whats the correct way of raising an even to complete a sub workflow?

Your help will be greatly appreciated.

Thanks,

Andy

Accepted Solutions (1)

Accepted Solutions (1)

former_member186746
Active Contributor
0 Kudos

Andy Smith wrote:

I have tried to raise an event but its now working,

I would focus on this issue.

If you want to control parallel processes where one thing (read event) can end all of those processes then you have to use create event steps and wait for event steps.

For the above you create a 1:2 fork in one branch you wait for an event and in the other you put your X:Y fork. This is the best and most flexible way of modeling business process with SAP Workflow.

If, as you say, it is not working then find out why and fix it.

Kind regards, Rob Dielemans

Answers (3)

Answers (3)

Former Member
0 Kudos

You mention that you raised the event but its not working.. Any luck checking the event trace. What are your findings there ?

Who is responding to the event .. if no one is receiving your event then certainly there must be some glitch in the way you are handling that event in your sub workflow.

I might try setting the sub workflow to obsolete when the event occurs.

Also just as a reminder : you need to commit after raising event. Hope you are doing that.

--

Linkin

Former Member
0 Kudos

Hi,

You could put another fork before the current one with 3 branches. Move the current fork into the other branch of the new fork. Now you should have one empty branch and one with the current fork. Now put your condition to the empty branch (=wait for condition type of step). Once the condition gets fulfilled, the workflow should continue (given that you have set the necessary branched to '01' for the new fork).

If you have a way to create an event, you could replace the wait for condition step with wait for event step. I personally prefer events.

One thing: Do you have all the necessary background jobs running for workflow. Check this from SWU3. There is a job that checks the conditions for every 3 minutes or so, and if it this job is not running, no condition checks will work (even my solution will not work - it might even be that your current solution is correct, but due to the missing background job it is not working).

Regards,

Karri

ronen_weisz
Active Contributor
0 Kudos

There should be an option to add a condition to end the fork (below the 3 out of 3 in the ending of the fork), have you used this option and the sub-workflow is not logically deleted? 

You can also try a process control (if one of the branches sets the urgent option) to terminate the sub-workflow, but I think that the condition should work by itself.

former_member185540
Active Participant
0 Kudos

Hi Ronen,

i have used the condition and said if urgent = x then exit the fork. this is not working. the fork still waits..

that's why i thought of raising an event to complete the workflow but i am stuck there.

i will try the process control but should that be in the fork or outside?

Former Member
0 Kudos

Hi Andy,

You can achieve this by these ways.

1. Event : You can raise a event on URGENT = X , and put the same in TERMINATION conidition of your subworkflow. Go to header data of subworkflow , you will find there "Start Event" and "terminate events"

2. YOu can use process control and choose there "Terminate current workitem/node" exactly when URGENT = X happend.

Please try and let us know if it solved your problem.

Thanks

Rakesh