Usage of Step type Fork
By using fork you execute several process in parallel. While creating Fork, you have to enter no of parallel branches and necessary branches.
For example:- Lets take a scenario where an employee applies for a leave. In order to get the leave he need to send mail to 3 managers. Here we use fork where simultaneous process can happen. So 3 parallel branches and out of which all 3 are necessary that means final mail comes only when all 3 managers gives there decision.
1. Open the workflow builder using Tcode SWDD
Right click on undefined and select the step as Fork.
2. Give Parallel and Necessary branches as 3.
Press Transfer to graphic button. Work flow becomes as below.
We can see from below screen shot 3 parallel branches appearing.
3. Right click on one of 3 parallel branches undefined and select step type as User Decision.
Give title and Decision options.
Press transfer and to graphic button.
4. Workflow appears as below.
Follow the same process for other 2 giving user decision as step type.
Workflow appears as below.
5. Under Manager1 user decision. Add 2 mail steps one for Yes and one for No.
If Yes then add mail as Manager 1 approved the leave request.
If No then add mail as Manager 1 rejected the leave request.
6. Follow the same process for Manager2 and Manager3 User Decision. By adding the mail step types.
Now workflow becomes as:
7. In fork step we gave necessary branches as 3. So when all 3 managers gives there decision then fork step will be completed and moves to next step.
Add mail step after fork step giving the message that ‘Leave process completed’ in order to intimate the user about the leave process completed.
Press transfer to graphic button.
8. Final work flow appears as below:
Activate the work flow and execute it.
9. So in user inbox (SBWP) we can find 3 mails as below.
So when all managers gives there decision 4 mails will appear in user inbox. 3 on there decision and final mail about leave process completed.