Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Salary Processing Use Case

In this document we will see how to perform various operations like lookup, group by, sorting, merging,
renaming etc. We will implement Salary Processing Use case in which we calculate employee net salary
considering his total working hours and allowance according to designation. We will be reading data from
three input files and consolidating the data to achieve the task. After calculating net salary of each employee,
we will send XML output file via email to a particular person.

Scenario of Workflow

Building workflow
1. In process studio, create a new workflow and save it as shown in below images:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
2. Create three input excel files (Employee_List.xlsx, Employee_TimeSheets.xlsx, AllowanceInput.xlsx) as shown
in below images:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
In this file, we have data of a particular month (January) for every employee day-wise.

3. Drag and drop a “Microsoft Excel input” step to read “Employee_List.xlsx” file. Double click on it to configure it
as follows:

Files Tab:
1. Rename the step as “INF_EmployeeDetails”
2. In “Spread sheet type (engine)” field, select file extension as “Excel 2007 XLSX (Apache POI)”
3. Browse the file “Employee_List.xlsx”
4. Click on “Add” button and it will added to “Selected Files” section
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
5. Click on “Show filename(s)” button to ensure about the path and extension of the input file.

Sheets Tab:

1. Click on “Get sheetname(s)” button


2. Select sheet as “Sheet1” from which we want to read data

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Fields Tab:

Click on “Get fields from header row” button to fetch all columns from the input file.
Note: You can select “Format” also if required for any column.
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
Click on “Preview rows” button to ensure that it is reading data from input file or not.

Click on “Close” >> “OK” button to complete configuration.

4. Drag and drop another “Microsoft Excel input” step to read “Employee_TimeSheets.xlsx” file. Double click on
it to configure it as follows:
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
Files Tab:
1. Rename the step as “INF_TimeSheetDetails”
2. In “Spread sheet type (engine)” field, select file extension as “Excel 2007 XLSX (Apache POI)”
3. Browse the file “Employee_timeSheets.xlsx”
4. Click on “Add” button and it will added to “Selected Files” section
5. Click on “Show filename(s)” button to ensure about the path and extension of the input file.

Sheets Tab:

1. Click on “Get sheetname(s)” button


2. Select sheet as “Sheet1” from which we want to read data

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Fields Tab:

Click on “Get fields from header row” button to fetch all columns from the input file.
Note: You can select “Format” also if required for any column.
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
Click on “Preview rows” button to ensure that it is reading data from input file or not.

Click on “Close” >> “OK” button to complete configuration.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
5. Drag and drop “Sort rows” step to sort the “Employee_TimeSheets” data according to “Employee_ID”.
Double-click on it to configure its property as shown in below image:

Click on “OK” button.

6. Drag and drop “Group By” step to calculate the total working hours of each employee. Refer below image to
configure its properties:

Click on “OK” >> “I understand”.

Save and execute your workflow. You can see the result of “Group By” step in “Preview data” tab as shown in
below image:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
7. Now, Drag and drop “Stream Value Lookup” step to lookup rows from “INF_EmployeeDetails” and
“INF_TimeSheetDetails” steps after sorting and grouping data by employee.

“The key(s) to look up the value(s)” section:


 In Field column, select “Emp_Id” from drop-down which is coming from “INF_EmployeeDetails” step
 In LookupField column, select “Employee_ID” from drop-down which is coming from
“INF_TimeSheetDetails” step

“Specify the fields to retrieve” section:


 In Field column, select “TotalNumberOfHrs” from drop-down which is coming from “Group by EmpId”
step
 In Type column, select type of column

Below is the image for your reference:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Click on “OK” button.

8. Drag and drop “Sort rows” step to sort the data by “Role”. Double-click on it to configure its property as
shown in below image:

9. Drag and drop “Microsoft Excel input” step to read “AllowanceInput.xlsx” file. Double click on it to configure it
as follows:

Files Tab:
1. Rename the step as “INF_AllowanceDetails”
2. In “Spread sheet type (engine)” field, select file extension as “Excel 2007 XLSX (Apache POI)”
3. Browse the file “AllowanceInput.xlsx”
4. Click on “Add” button and it will added to “Selected Files” section
5. Click on “Show filename(s)” button to ensure about the path and extension of the input file.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Sheets Tab:

1. Click on “Get sheetname(s)” button


2. Select sheet as “Sheet1” from which we want to read data

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Fields Tab:

Click on “Get fields from header row” button to fetch all columns from the input file.
Note: You can select “Format” also if required for any column.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Click on “Preview rows” button to ensure that it is reading data from input file or not.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Click on “Close” >> “OK” button to complete configuration.

10. Drag and drop “Sort rows” step to sort the allowance data by “Role”. Double-click on it to configure its
property as shown in below image:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
11. Drag and drop a “Merge Join” step to merge rows from “Sort rows By Role” and “SortByRole2” steps. Double-
click on it to configure its properties as shown in below images:

 In First Step, select “Sort rows By Role” from drop-down


 In Second Step, select “SortByRole2” from drop-down

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
st nd
Now, click on “Get key fields” button to get the fields in “Keys for 1 step” and “Keys for 2 step” as shown in
below figure:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
After this, remove all the fields from both the sections except “Role” as shown in below image:

Click “OK” >> “I understand”.

12. Drag and drop “Rename Fields” step to rename any field and remove any unwanted fields from the workflow
stream. Refer below image to configure its properties:

Click on “Get fields to select” button to fetch all the fields available in workflow stream.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Now remove unwanted fields and rename fields if required (Optional).

Renaming “Date of Joining”, “TotalNumberOfHrs” and “Allowance/Hour” fields


Removing “Role_1” field

Click on “OK” button.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
13. Drag and drop “Calculator” step to calculate employee salary by computing “AllowancePerHour” and
“TotalTime”. Below is the image for reference:

14. Now we need to save output in an XML file. Drag and drop “XML Output” step and connect it with the
previous step (Calc_TotalSalary) step. Double-click on it to configure its properties:

File Tab:
 Specify a Filename with complete path where you want to save the output file.
 Mention Extension as “xml”
 “Add filenames to result” checkbox should be checked. If it is not, then output file will not be added to the
result for further processing e.g. sending o/p file as an attachment in an email.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Content Tab:
 “Parent XML element”: Mention parent element name
 “Row XML element”: Mention row element name (every row will be enclosed in this row element
name)

Fields Tab:
 Click on “Get Fields” button to fetch all the fields available in workflow stream

 In Content type column, select “Element” or “Attribute” from drop-down depending on your requirement,
which column you want to save as element (XML tag) and which one as attribute of that element.
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
Let see the output file, if we select “Element” for every field as shown in below figure:

Save and Run the workflow.

XML Output file:

You can notice that,


 “Employees” as parent XML tag
 “Employee” as each row XML tag
 Every field as child XML tags

Now, let see the output file, if we select “Element” for few fields and “Attribute” for few fields as shown in
below figure:
© 2018 AutomationEdge Inc. All Rights Reserved.
This document is for your company’s internal use only and may not be distributed to any third party.
Save and Run the workflow.

XML Output file:

You can notice that,


 Fields “Department”, “Emp_Id” and “Name” as attributes of “Employee” element

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Now we need to send XML output file via email to a particular person. To achieve this, we need to create
Process.

Building Process

15. In process studio, create a new process and save it as shown in below images:

16. In process, we need put entries “START” and “Success” in starting and at the end of the process as shown in
below image:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
17. Now we need to call “WF_SalaryProcessing” workflow from the “PR_SalaryProcessing” process. To achieve
this, drag and drop “Workflow” entry and connect it with “START” entry. Double-click on it to configure its
properties. Refer below image for your reference:

Workflow specification Tab:


 In “Workflow filename” textbox, give path of “WF_SalaryProcessing.psw” workflow. You can browse for the
same by clicking on button.

Note:
${Internal.Entry.Current.Directory}: It refers to the current directory of “PR_SalaryProcessing.psp”, so that if
you change the location of your parent folder (where you are saving all workflows/process, input/output
folder), then also no change is required in path of “WF_SalaryProcessing.psw” workflow in “Workflow” entry.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
18. Next, we need to send XML output file via mail to a particular person. For this, drag and drop “Mail” entry and
connect it with previous (Workflow) and next (Success) entries as shown in below image.

Double-click on “Mail” entry to configure its properties as shown in below images:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Addresses Tab:

Server Tab:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Email Message Tab:

Message Settings:

 Include date in message? : If you want to include date in mail body, then you can select this
checkbox.
 Only send comment in mail body? : By selecting this checkbox, mail body doesn’t include auto-
generated code. It will include only “Comment” in mail body which we have defined.
 Use HTML format in mail body: select this checkbox when you are using HTML tags in “Comment”.
 Manage priority: You can prioritize the email selecting this checkbox.

Message:

 Subject: Mention subject of the email


 Comment: Define email body in here. You can use HTML tags also to customize it.

Note: If you are using HTML tags in “Comment”, check the “Use HTML format in mail body” checkbox to
enable it. Otherwise it won’t work.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
Attached Files Tab:

Check the “Attach file(s) to message?” checkbox and choose “General” from “Select file type:” list as shown in
below image:

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.
19. Save and Run the “PR_SalaryProcessing.psp”. Check your email account for output.

© 2018 AutomationEdge Inc. All Rights Reserved.


This document is for your company’s internal use only and may not be distributed to any third party.

You might also like