Skip to content

Commit 49bf8a1

Browse files
authored
Adding new workday sample scenarios (#384)
* adding sample scenarios for ESS workday agent * improving structure and adding new requesting timeoff topic and get vacation topic * fixing topic for request time off * renaming files * fixed readme.md
1 parent f1a8594 commit 49bf8a1

File tree

21 files changed

+2578
-0
lines changed

21 files changed

+2578
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<workdayEntityConfigurationTemplate>
2+
<scenario name="GetTimeOffBalance">
3+
<apiRequests>
4+
<apiRequest>
5+
<authType>User</authType>
6+
<endpoint>
7+
<request>Template_GetTimeOffBalances_Request</request>
8+
<serviceName>Absence_Management</serviceName>
9+
<version>v42.0</version>
10+
</endpoint>
11+
12+
<requestParameters>
13+
<parameter>
14+
<name>Employee_ID</name>
15+
<value>{Employee_ID}</value>
16+
</parameter>
17+
</requestParameters>
18+
19+
<responseProperties>
20+
<!-- Remaining balance -->
21+
<property>
22+
<key>RemainingBalance</key>
23+
<extractPath>
24+
//*[local-name()='Time_Off_Plan_Balance_Record']
25+
/*[local-name()='Time_Off_Plan_Balance_Position_Record']
26+
/*[local-name()='Time_Off_Plan_Balance']/text()
27+
</extractPath>
28+
</property>
29+
30+
<!-- Plan descriptor -->
31+
<property>
32+
<key>PlanDescriptor</key>
33+
<extractPath>
34+
//*[local-name()='Time_Off_Plan_Balance_Record']
35+
/*[local-name()='Time_Off_Plan_Reference']/@*[local-name()='Descriptor']
36+
</extractPath>
37+
</property>
38+
39+
<!-- Plan ID (Absence_Plan_ID) -->
40+
<property>
41+
<key>PlanID</key>
42+
<extractPath>
43+
//*[local-name()='Time_Off_Plan_Balance_Record']
44+
/*[local-name()='Time_Off_Plan_Reference']
45+
/*[local-name()='ID'][@*[local-name()='type']='Absence_Plan_ID']/text()
46+
</extractPath>
47+
</property>
48+
49+
<!-- Unit of Time -->
50+
<property>
51+
<key>UnitOfTime</key>
52+
<extractPath>
53+
//*[local-name()='Time_Off_Plan_Balance_Record']
54+
/*[local-name()='Unit_of_Time_Reference']/@*[local-name()='Descriptor']
55+
</extractPath>
56+
</property>
57+
</responseProperties>
58+
</apiRequest>
59+
</apiRequests>
60+
</scenario>
61+
62+
<requestTemplates>
63+
<requestTemplate name="msdyn_HRWorkdayHCMEmployeeGetVacationBalance">
64+
<bsvc:Get_Time_Off_Plan_Balances_Request xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v42.0">
65+
66+
<!-- Request Criteria -->
67+
<bsvc:Request_Criteria>
68+
<bsvc:Employee_Reference>
69+
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
70+
</bsvc:Employee_Reference>
71+
</bsvc:Request_Criteria>
72+
73+
<!-- Response Filter (pagination) -->
74+
<bsvc:Response_Filter>
75+
<bsvc:Page>1</bsvc:Page>
76+
<bsvc:Count>100</bsvc:Count>
77+
</bsvc:Response_Filter>
78+
79+
</bsvc:Get_Time_Off_Plan_Balances_Request>
80+
</requestTemplate>
81+
</requestTemplates>
82+
</workdayEntityConfigurationTemplate>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
kind: AdaptiveDialog
2+
modelDescription: |-
3+
You will respond to requests about the total time off balance of the user making the request. This data is retrieved from Workday. You will respond to the user based on which piece of data they are asking for. This data exclusively belongs to the user making the request. There is no data for anyone else. Do not respond to questions about other people's data.
4+
5+
Example invalid requests:
6+
"What is my manager's vacation balance?"
7+
"What is my sister's vacation balance?"
8+
9+
Example valid requests:
10+
"What is my vacation balance?"
11+
beginDialog:
12+
kind: OnRecognizedIntent
13+
id: main
14+
intent:
15+
triggerQueries:
16+
- What is my vacation balance?
17+
- How much time off can I take?
18+
- what is my workday vacation balance?
19+
20+
actions:
21+
- kind: BeginDialog
22+
id: Y74Om4
23+
displayName: Redirect to Workday Get Common Execution
24+
input:
25+
binding:
26+
parameters: ="{""params"":[{""key"":""{Employee_ID}"",""value"":""" & Global.ESS_UserContext_Employee_Id & """},{""key"":""{As_Of_Effective_Date}"",""value"":"""& Text(Today(), "yyyy-MM-dd") &"""}]}"
27+
scenarioName: msdyn_HRWorkdayHCMEmployeeGetVacationBalance
28+
29+
dialog: msdyn_copilotforemployeeselfservice.topic.WorkdaySystemGetCommonExecution
30+
output:
31+
binding:
32+
errorResponse: Topic.errorResponse
33+
isSuccess: Topic.isSuccess
34+
workdayResponse: Topic.workdayResponse
35+
36+
- kind: SearchAndSummarizeContent
37+
id: igank3
38+
userInput: =Topic.workdayResponse
39+
additionalInstructions: Only reply back with the Vacation Balance. Format the response in in friendly way and make sure to tie it back directly to the orginal question of the user. ({System.Activity.Text}). Never include the "Plan ID".
40+
customDataSource:
41+
searchResults: |
42+
=Table({Content: Topic.workdayResponse})
43+
44+
inputType: {}
45+
outputType:
46+
properties:
47+
finalizedData:
48+
displayName: finalizedData
49+
type:
50+
kind: Record
51+
properties:
52+
CostCenterCode: String
53+
CostCenterName: String
54+
EmployeeName: String
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<workdayEntityConfigurationTemplate>
2+
<scenario name="EmployeeEnterTimeOff">
3+
<apiRequests>
4+
<apiRequest>
5+
<authType>User</authType>
6+
<endpoint>
7+
<request>msdyn_HRWorkdayAbsenceEnterTimeOff_EnterTimeOffInfo</request>
8+
<serviceName>Absence_Management</serviceName>
9+
<version>v42.0</version>
10+
</endpoint>
11+
<requestParameters/>
12+
<responseProperties>
13+
<property>
14+
<extractPath>//*[local-name()='Time_Off_Event_Reference']/*[local-name()='ID' and @*[local-name()='type']='WID']</extractPath>
15+
<key>WID</key>
16+
</property>
17+
</responseProperties>
18+
</apiRequest>
19+
</apiRequests>
20+
</scenario>
21+
<requestTemplates>
22+
<requestTemplate name="msdyn_HRWorkdayAbsenceEnterTimeOff_EnterTimeOffInfo">
23+
<wd:Enter_Time_Off_Request xmlns:wd="urn:com.workday/bsvc" wd:version="v42.0">
24+
<wd:Business_Process_Parameters>
25+
<wd:Auto_Complete>false</wd:Auto_Complete>
26+
<wd:Run_Now>true</wd:Run_Now>
27+
<wd:Discard_On_Exit_Validation_Error>true</wd:Discard_On_Exit_Validation_Error>
28+
<wd:Comment_Data>
29+
<wd:Comment>{Comment}</wd:Comment>
30+
</wd:Comment_Data>
31+
</wd:Business_Process_Parameters>
32+
<wd:Enter_Time_Off_Data>
33+
<wd:Worker_Reference>
34+
<wd:ID wd:type="Employee_ID">{Employee_ID}</wd:ID>
35+
</wd:Worker_Reference>
36+
<!-- One entry per date -->
37+
<wd:Enter_Time_Off_Entry_Data>
38+
<wd:Date>{Time_Off_Date}</wd:Date>
39+
<wd:Requested>{Hours}</wd:Requested>
40+
<wd:Time_Off_Type_Reference>
41+
<wd:ID wd:type="Time_Off_Type_ID">{Reason_ID}</wd:ID>
42+
</wd:Time_Off_Type_Reference>
43+
<wd:Comment>{Comment}</wd:Comment>
44+
</wd:Enter_Time_Off_Entry_Data>
45+
</wd:Enter_Time_Off_Data>
46+
</wd:Enter_Time_Off_Request>
47+
</requestTemplate>
48+
</requestTemplates>
49+
</workdayEntityConfigurationTemplate>

0 commit comments

Comments
 (0)