Gyan Factory

Gyan Factory
SAP Technical Project Support

Tuesday, January 5, 2016

Workflow : Demo7- Uses of ForK and wait Event

Check Link : Workflow : Demo3- Triggering work flow with class event


Post Summary: The below post describes how to creates fork and wait event in work flow. 


Step1.  Create a class in SE24 and implement the interface IF_WORKFLOW to enable this class to participate in work flow.
Define below events.



Step2. Create below attributes.



Step3. Create constructor and some other methods. Some methods are came form the implemented interface.
Define the methods as given below. Some of the methods has to be activated without any body.





Step4. Put the code like below.



Step5. Put the code like below.


Step6. Put the code like below. This events triggers the work flow start.


Step7. Put the code like below.



Step8. Put the code like below.




Step9. Put the code like below.


Step10. In Tx- SWDD create a work flow and Save it.


Step11. Provide description and save.



Step12. Let's create some container elements.



Step13. Double click to create. Provide the details & then click on Properties tab.


Step14. Choose export and import.


Step15. Now go to the header of the work flow to maintain the start event.



Step16. provide the class and from F4 select the start event.


Step17. Click on binding.


Step18.  Do this kind of binding and continue.


Step19. Sabve and go back to the work flow home.



Step20. Double click on the step to define it..



Step21. choose FORK. It is used when a multi path processing needed.


Step22. Provide how many parallel branches and an end condition. Here we put 01 means if one of the branch has finished execution then work flow form processing will be finished.




Step23. So here we are and now define the steps. Double click on the first one.



Step24. Choose an wait event.




Step25. Provide the wait events and select the binding.


Step26.  here is the binding.


Step27. Continue.



Step28. Double click on another path to define it.





Step29. Choose wait event.


Step30. Provide the wait events and select the binding.


Step31. Do the binding and continue.



Step32. Define the last step of the fork.




Step33. Choose wait event.


Step34. Provide the wait events and select the binding.


Step35. Do binding and continue.



Step36. Now activate the work flow.



Step37. Execute the program.


Step38. Run by work flow start.




Step39. Go to Tx- SWI1 and check the work flow log.



Step40. Select the icon.



Step41. select the graph icon


Step42. The work flow has been triggered and the three parallel step is started processing and each one is waiting for the waiting event to occur which will complete the work flow.


Step43. run the same program with option FORK3.





Step44. Go to Tx- SWI1 and refresh it. See the work flow completed and path 1 and path 2 are set as logically deleted as the work flow completed by path 3 triggering even.


Step45. Go to the Tx- SWDD and Double click on the fork.


Step46. Change the End condition as 02. Means  the work flow will be completed if 2 of the 3 branches finished their execution.


Step47. Trigger the start event.




Step48. In Tx- SWI1 we have the work flow status.


Step49. trigger the FORK 1 waiting event.



Step50. So here is the processing log of the work flow.


Step51. In the program trigger event associated with fork 2.




Step52. So the work flow completed with path 3 set as logically deleted.

No comments:

Post a Comment