The leave application process involves a resource seeking leave (the Applicant) by submitting a leave application. The resource has to give the dates and the reason for taking the leave. The leave application has to be approved by the manager(s) to whom the resource reports. The leave details are stored in the LeaveApplications and LeaveStatus tables.
In the sample application being discussed, this process involves two Resources (the Approvers) to sanction the leave. They are the Manager to whom the Applicant reports and the Administrator. In the sample process, this involves the checking of the Loss of Pay (LOP) value, which determines if the leave applied for involves a loss of pay. Based on the result of the check, the workflow goes to the first Approver or back to the Applicant, who will have to confirm that he or she wishes to avail leave with loss of pay. If the user wishes to take leave with loss of pay, the workflow goes to the first Approver for his or her approval. After approval by the first approver, the leave application is assigned to the second approver. If the leave application is approved, then tasks like calculating loss of pay, incrementing the leaves taken and reducing the available leaves are performed. If the request is rejected, then the application is removed from the LeaveApplications table. This topic discusses the flow of actions in the workflow process design.
To view the actions involved in the Workflow defined for the sample Leave Application
1. Open the Admin Login Page and login to the admin section by selecting the following login name and clicking the Submit button:
username: Daniel@skeltademo.com
2. Go to the Leave Process Designer option in the Main Menu.
To access the Leave Application
1. Click on http://localhost/SkeltaSample/Samples.aspx
This opens the Skelta Sample Applications Main Page. Alternatively you can select the Application Submission Page in the Main Menu of the Admin Login to go to the Sample Applications Main Page.
2. In this page select the Leave Application option by clicking the corresponding radio button.
Consider a scenario in which a resource named Jim submits a leave application. This will have to be approved by Jim's manager, Victor, and the Administrator, Daniel. In the sample application, the workflow process starts when a 'leave form' is submitted by Jim. On submission the Workflow engine is alerted and the process begins.
Go through the Organization Chart, to understand the hierarchy of resources involved in the Skelta Sample Applications.
To see how the Workflow actions take place, follow the steps given below:
1. Leave Application Submission
a. After selecting the Leave Application option in the Sample Applications Main Page, click on the Submit button to open the Sample Application User Login Page.
In this page, select a user with the email ID Jim@skeltademo.com from the list and submit.
User details can be viewed in the admin login or from the Users table.
b. Go to Leave Application in the Main Menu.
c. Enter the Leave Details and submit.
Note: Click on the View Workflow Submission Code link to view Content Data passed to the workflow (the Content is initialized in the LeaveApplication Process Designer’s Start Action).
After the submission button is clicked, the Engine is alerted about the leave application submission, and the client will be redirected to the appropriate Activity List page, whose URL is specified in the RedirectionURL property of the Information and Checklist actions. This is done on the basis of the LossOfPay value, explained below.
2. Check for Loss of Pay
The workflow has a Script action called CheckLossofPay, which checks for the LossOfPay value, i.e., Content.lop which is passed as Content in the Execute Method.
If the value of LeaveApplication.lop is zero, then a message will be sent to the Applicant, i.e., Jim in this example, informing him of successful submission of the Leave Application. The Leave Application is sent to the manager to whom Jim reports, i.e., Victor.
If the value of LeaveApplication.lop is greater than zero, a Checklist action (LOPConfirmation Action) will be sent to the Applicant for obtaining confirmation on whether to process the leave with loss of pay, or cancel the leave application.
3. To view the Checklist Action and take action
a. Go to the Sample Application User Login Page.
In this page, select a user with the email ID Jim@skeltademo.com from the list and submit.
b. Go to Activity List in the Main Menu.
c. The Activity List Control included in this page will show the Checklist action, which waits for Jim’s decision.
The decision is indicated by selecting the appropriate answer in the checklist.
d. If the decision is Yes, then the leave application will be sent to Jim’s manager, i.e., Victor.
To view the status of the Leave Application, click on the View Leave/Expense Status link in the Main Menu.
Click on the View link in the last column of the status report to see a graphical view of the pending Leave Application's status.
e. If the decision is No, then the leave application is cancelled and information is sent to Jim mentioning the cancellation of the Leave Application.
Leave details are removed from the LeaveApplication database.
The leave requested for, which was added to the UserLeavediary database when the Leave Application was submitted, is reduced from the total leaves availed by the user in the database.
The Workflow status comes to FN.
4. Manager's Approval
a. Go to the Sample Application User Login Page.
In this page, select a user with the email ID Victor@skeltademo.com from the list and submit.
User details can be viewed in the admin login or from the Users table.
b. Go to Activity List in the Main Menu.
c. The Activity List Control included in this page will show a listing view of the Leave Application submitted for approval to the resource currently logged in, while the Activity UI Control that is also included will show the detailed view of a selected activity.
d. Clicking on the Ref Id or Workflow will display the detailed view of the Leave Application.
e. Approve and Reject buttons have been provided for action to be taken by the Manager.
If approved,
i. Then the Leave Application is sent to the Administrator for final approval.
If rejected,
i. Information is sent to the Applicant.
ii. Leave details are removed from the LeaveApplication database.
iii. The leave requested for, which was added to the UserLeavediary database when the Leave application was submitted, is reduced from the total leaves availed by the user in the database.
5. Administrator Approval
a. Go to the Sample Application User Login Page.
In this page, select a user with the email ID Daniel@skeltademo.com from the list and submit.
User details can be viewed in the admin login or from the Users table.
b. Go to Activity List in the Main Menu.
c. The Activity List Control included in this page will show a listing view of the Leave Application submitted for approval to the resource currently logged in, while the Activity UI Control that is also included will show the detailed view of a selected activity.
d. Clicking on the Ref Id or Workflow will give a Detailed view of the Leave Application.
e. Approve and Reject Buttons have been provided for action to be taken by the Administrator.
If approved,
i. Information is sent to the Applicant, i.e., Jim
ii. The Status field in LeaveApplications table is updated to "approved".
If rejected,
i. Information is sent to the Applicant
ii. Leave details are removed from the LeaveApplications database
iii. The leave requested for, which was added to the UserLeavediary database when the Leave application was submitted, is reduced from the total leaves availed by the user in the database.
Note: If there is more than one person responsible for the Approval Action, then the Approval decision is taken after all of them act on the Approval (which is based on whether the status of the property "Wait for all participants to act" is ‘Yes’ or ‘No’). If timeout property is set then the decision is taken once the timeout is reached.