Skip to content

Commit cd472a2

Browse files
User/ankurrana/supporting phase 1 workday topics (#432)
* Reverting changes added by AI * Fixing schema name for phase 1 open source topics * Updating Scenario name in the topic definition * Update Residential Address Scenario in Workday * Updating scenario name * Handing Dependents from Get Emergency Contacts * Adding Employee Add Dependents --------- Co-authored-by: Ankur Rana <ankurrana@microsoft.com>
1 parent 8bc4a32 commit cd472a2

8 files changed

Lines changed: 1712 additions & 0 deletions

File tree

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Add Dependents
2+
3+
This scenario allows employees to add new dependents to their Workday profile for benefits enrollment purposes.
4+
5+
## Overview
6+
7+
The `AddDependents` topic allows employees to:
8+
1. **View** their existing dependents
9+
2. **Add** a new dependent (spouse, child, domestic partner, etc.)
10+
11+
## Flow
12+
13+
```
14+
┌─────────────────────────────────────┐
15+
│ User triggers topic │
16+
└──────────────┬──────────────────────┘
17+
18+
19+
┌─────────────────────────────────────┐
20+
│ Fetch reference data │
21+
│ (Relationship Types) │
22+
└──────────────┬──────────────────────┘
23+
24+
25+
┌─────────────────────────────────────┐
26+
│ Fetch existing dependents │
27+
│ (msdyn_HRWorkdayHCMEmployee │
28+
│ GetDependents) │
29+
└──────────────┬──────────────────────┘
30+
31+
32+
┌──────┴──────┐
33+
│ Dependents │
34+
│ exist? │
35+
└──────┬──────┘
36+
37+
┌───────┴───────┐
38+
│ │
39+
▼ ▼
40+
┌──────────────┐ ┌──────────────┐
41+
│ Show list of │ │ "No deps on │
42+
│ existing │ │ file yet" │
43+
│ dependents │ │ │
44+
└──────┬───────┘ └──────┬───────┘
45+
│ │
46+
└───────┬────────┘
47+
48+
49+
┌─────────────────────────────────────┐
50+
│ Show Add Dependent Form │
51+
│ (Adaptive Card) │
52+
└──────────────┬──────────────────────┘
53+
54+
55+
┌─────────────────────────────────────┐
56+
│ Show Confirmation Card │
57+
└──────────────┬──────────────────────┘
58+
59+
60+
┌─────────────────────────────────────┐
61+
│ Submit to Workday │
62+
│ (msdyn_HRWorkdayHCMEmployee │
63+
│ AddDependent) │
64+
└──────────────┬──────────────────────┘
65+
66+
67+
┌─────────────────────────────────────┐
68+
│ Show success/error message │
69+
└─────────────────────────────────────┘
70+
```
71+
72+
## Files
73+
74+
| File | Purpose |
75+
|------|---------|
76+
| `AddDependents_Topic.yaml` | Main topic definition with full flow |
77+
| `msdyn_GetDependents_Template.xml` | XML template for fetching existing dependents |
78+
| `msdyn_AddDependent_Template.xml` | XML template for adding a new dependent |
79+
80+
81+
## API Scenarios Used
82+
83+
| Scenario | API | Purpose |
84+
|----------|-----|---------|
85+
| `msdyn_HRWorkdayHCMEmployeeGetDependents` | Human_Resources v45.0 | Fetch existing dependents |
86+
| `msdyn_HRWorkdayHCMEmployeeAddDependent` | Benefits_Administration v45.1 | Add new dependent |
87+
88+
## XPath Filtering
89+
90+
The Get Dependents template uses XPath predicates to filter only actual dependents (excluding emergency contacts):
91+
92+
```xpath
93+
//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]
94+
```
95+
96+
This ensures that only `Related_Person` nodes containing a `Dependent` child element are returned.
97+
98+
## Form Fields
99+
100+
| Field | Type | Required | Source |
101+
|-------|------|----------|--------|
102+
| First Name | Text Input | Yes | User entry |
103+
| Last Name | Text Input | Yes | User entry |
104+
| Date of Birth | Date Input | Yes | User entry |
105+
| Gender | Dropdown | Yes | Hardcoded (Male, Female, Not_Declared) |
106+
| Relationship | Dropdown | Yes | Dynamic from `Global.RelatedPersonRelationshipLookupTable` |
107+
| Country | Dropdown | Yes | Hardcoded (USA, CAN, GBR, AUS, DEU, FRA, IND) |
108+
109+
## Parameters
110+
111+
### Add Dependent Template Parameters
112+
113+
| Parameter | Description | Example |
114+
|-----------|-------------|---------|
115+
| `{Employee_ID}` | Employee's Workday ID | `21514` |
116+
| `{First_Name}` | Dependent's first name | `John` |
117+
| `{Last_Name}` | Dependent's last name | `Smith` |
118+
| `{Date_Of_Birth}` | Date of birth (YYYY-MM-DD) | `2015-06-15` |
119+
| `{Gender}` | Gender code | `Male` / `Female` / `Not_Declared` |
120+
| `{Relationship_Type}` | Relationship type ID | `Biological_Child` |
121+
| `{Country_Code}` | Country ISO code | `USA` |
122+
123+
### Get Dependents Template Parameters
124+
125+
| Parameter | Description | Example |
126+
|-----------|-------------|---------|
127+
| `{Employee_ID}` | Employee's Workday ID | `21514` |
128+
| `{As_Of_Effective_Date}` | Effective date (YYYY-MM-DD) | `2025-12-30` |
129+
130+
## Response Data Extracted
131+
132+
### Get Dependents Response
133+
134+
| Key | XPath | Description |
135+
|-----|-------|-------------|
136+
| `DependentID` | `.//ID[@type='Dependent_ID']` | Unique dependent identifier |
137+
| `DependentWID` | `.//ID[@type='WID']` (Dependent_Reference) | Workday Internal ID |
138+
| `PersonWID` | `.//ID[@type='WID']` (Person_Reference) | Person reference WID |
139+
| `FullName` | `.//Name_Detail_Data/@Formatted_Name` | Full formatted name |
140+
| `FirstName` | `.//First_Name` | First name |
141+
| `LastName` | `.//Last_Name` | Last name |
142+
| `DateOfBirth` | `.//Dependent_Data/Date_of_Birth` | Date of birth |
143+
| `Gender` | `.//Dependent_Data/Gender_Reference/@Descriptor` | Gender |
144+
| `RelationshipTypeID` | `.//Related_Person_Relationship_ID` | Relationship type ID |
145+
| `IsFullTimeStudent` | `.//Full_Time_Student` | Full-time student flag |
146+
| `IsDisabled` | `.//Disabled` | Disabled flag |
147+
148+
### Add Dependent Response
149+
150+
| Key | XPath | Description |
151+
|-----|-------|-------------|
152+
| `DependentWID` | `.//Dependent_Reference/ID[@type='WID']` | Created dependent WID |
153+
| `DependentID` | `.//Dependent_Reference/ID[@type='Dependent_ID']` | Created dependent ID |
154+
155+
## Example Triggers
156+
157+
- "Add a dependent"
158+
- "I want to add my child as a dependent"
159+
- "Add my spouse to my benefits"
160+
- "Register a new dependent"
161+
- "I need to add a family member"
162+
163+
## Dependencies
164+
165+
- `msdyn_copilotforemployeeselfservicehr.topic.GetReferenceData` - For fetching relationship types
166+
- `msdyn_copilotforemployeeselfservicehr.topic.WorkdaySystemGetCommonExecution` - For API execution
167+
- `Global.RelatedPersonRelationshipLookupTable` - Relationship types lookup
168+
- `Global.ESS_UserContext_Employee_Id` - Current user's employee ID
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<workdayEntityConfigurationTemplate>
2+
<scenario name="msdyn_HRWorkdayHCMEmployeeAddDependent">
3+
<apiRequests>
4+
<apiRequest>
5+
<authType>User</authType>
6+
<endpoint>
7+
<request>Template_AddDependentRequest</request>
8+
<serviceName>Benefits_Administration</serviceName>
9+
<version>v45.1</version>
10+
</endpoint>
11+
<responseProperties>
12+
<property>
13+
<extractPath>//*[local-name()='Dependent_Reference']/*[local-name()='ID' and @*[local-name()='type']='WID']/text()</extractPath>
14+
<key>DependentWID</key>
15+
</property>
16+
<property>
17+
<extractPath>//*[local-name()='Dependent_Reference']/*[local-name()='ID' and @*[local-name()='type']='Dependent_ID']/text()</extractPath>
18+
<key>DependentID</key>
19+
</property>
20+
</responseProperties>
21+
</apiRequest>
22+
</apiRequests>
23+
</scenario>
24+
<requestTemplates>
25+
<requestTemplate name="Template_AddDependentRequest">
26+
<bsvc:Add_Dependent_Request xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v45.1">
27+
<bsvc:Business_Process_Parameters>
28+
<bsvc:Auto_Complete>true</bsvc:Auto_Complete>
29+
<bsvc:Run_Now>true</bsvc:Run_Now>
30+
<bsvc:Discard_On_Exit_Validation_Error>true</bsvc:Discard_On_Exit_Validation_Error>
31+
<bsvc:Comment_Data>
32+
<bsvc:Comment>Dependent added via Copilot</bsvc:Comment>
33+
<bsvc:Worker_Reference>
34+
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
35+
</bsvc:Worker_Reference>
36+
</bsvc:Comment_Data>
37+
</bsvc:Business_Process_Parameters>
38+
<bsvc:Add_Dependent_Data>
39+
<bsvc:Employee_Reference>
40+
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
41+
</bsvc:Employee_Reference>
42+
<bsvc:Related_Person_Relationship_Reference>
43+
<bsvc:ID bsvc:type="Related_Person_Relationship_ID">{Relationship_Type}</bsvc:ID>
44+
</bsvc:Related_Person_Relationship_Reference>
45+
<bsvc:Use_Employee_Address>true</bsvc:Use_Employee_Address>
46+
<bsvc:Dependent_Personal_Information_Data>
47+
<bsvc:Person_Name_Data>
48+
<bsvc:Name_Detail_Data>
49+
<bsvc:Country_Reference>
50+
<bsvc:ID bsvc:type="ISO_3166-1_Alpha-3_Code">{Country_Code}</bsvc:ID>
51+
</bsvc:Country_Reference>
52+
<bsvc:First_Name>{First_Name}</bsvc:First_Name>
53+
<bsvc:Last_Name>{Last_Name}</bsvc:Last_Name>
54+
</bsvc:Name_Detail_Data>
55+
</bsvc:Person_Name_Data>
56+
<bsvc:Date_of_Birth>{Date_Of_Birth}</bsvc:Date_of_Birth>
57+
<bsvc:Gender_Reference>
58+
<bsvc:ID bsvc:type="Gender_Code">{Gender}</bsvc:ID>
59+
</bsvc:Gender_Reference>
60+
</bsvc:Dependent_Personal_Information_Data>
61+
</bsvc:Add_Dependent_Data>
62+
</bsvc:Add_Dependent_Request>
63+
</requestTemplate>
64+
</requestTemplates>
65+
</workdayEntityConfigurationTemplate>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<workdayEntityConfigurationTemplate>
2+
<scenario name="msdyn_HRWorkdayHCMEmployeeGetDependents">
3+
<apiRequests>
4+
<apiRequest>
5+
<authType>User</authType>
6+
<endpoint>
7+
<request>Template_GetDependentsRequest</request>
8+
<serviceName>Human_Resources</serviceName>
9+
<version>v42.0</version>
10+
</endpoint>
11+
<responseProperties>
12+
<!-- ONLY extract data from Related_Person nodes that have a Dependent child -->
13+
<!-- This ensures all arrays are aligned (only actual dependents) -->
14+
15+
<!-- Dependent ID -->
16+
<property>
17+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Dependent']/*[local-name()='Dependent_Reference']/*[local-name()='ID' and @*[local-name()='type']='Dependent_ID']/text()</extractPath>
18+
<key>DependentID</key>
19+
</property>
20+
<!-- Dependent WID -->
21+
<property>
22+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Dependent']/*[local-name()='Dependent_Reference']/*[local-name()='ID' and @*[local-name()='type']='WID']/text()</extractPath>
23+
<key>DependentWID</key>
24+
</property>
25+
<!-- Person WID (only for dependents) -->
26+
<property>
27+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Person_Reference']/*[local-name()='ID' and @*[local-name()='type']='WID']/text()</extractPath>
28+
<key>PersonWID</key>
29+
</property>
30+
<!-- Full Name (only for dependents) -->
31+
<property>
32+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Personal_Data']/*[local-name()='Name_Data']/*[local-name()='Legal_Name_Data']/*[local-name()='Name_Detail_Data']/@*[local-name()='Formatted_Name']</extractPath>
33+
<key>FullName</key>
34+
</property>
35+
<!-- First Name (only for dependents) -->
36+
<property>
37+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Personal_Data']/*[local-name()='Name_Data']/*[local-name()='Legal_Name_Data']/*[local-name()='Name_Detail_Data']/*[local-name()='First_Name']/text()</extractPath>
38+
<key>FirstName</key>
39+
</property>
40+
<!-- Last Name (only for dependents) -->
41+
<property>
42+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Personal_Data']/*[local-name()='Name_Data']/*[local-name()='Legal_Name_Data']/*[local-name()='Name_Detail_Data']/*[local-name()='Last_Name']/text()</extractPath>
43+
<key>LastName</key>
44+
</property>
45+
<!-- Date of Birth (only for dependents) -->
46+
<property>
47+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Personal_Data']/*[local-name()='Personal_Information_Data']/*[local-name()='Birth_Date']/text()</extractPath>
48+
<key>DateOfBirth</key>
49+
</property>
50+
<!-- Gender (only for dependents) -->
51+
<property>
52+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Personal_Data']/*[local-name()='Personal_Information_Data']//*[local-name()='Gender_Reference']/*[local-name()='ID' and @*[local-name()='type']='Gender_Code']/text()</extractPath>
53+
<key>Gender</key>
54+
</property>
55+
<!-- Relationship Type ID (only for dependents) -->
56+
<property>
57+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Related_Person_Relationship_Reference']/*[local-name()='ID' and @*[local-name()='type']='Related_Person_Relationship_ID']/text()</extractPath>
58+
<key>RelationshipTypeID</key>
59+
</property>
60+
<!-- Full-time Student flag -->
61+
<property>
62+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Dependent']/*[local-name()='Dependent_Data']/*[local-name()='Full-time_Student']/text()</extractPath>
63+
<key>IsFullTimeStudent</key>
64+
</property>
65+
<!-- Disabled flag -->
66+
<property>
67+
<extractPath>//*[local-name()='Related_Person_Data']/*[local-name()='Related_Person'][*[local-name()='Dependent']]/*[local-name()='Dependent']/*[local-name()='Dependent_Data']/*[local-name()='Disabled']/text()</extractPath>
68+
<key>IsDisabled</key>
69+
</property>
70+
</responseProperties>
71+
</apiRequest>
72+
</apiRequests>
73+
</scenario>
74+
<requestTemplates>
75+
<requestTemplate name="Template_GetDependentsRequest">
76+
<bsvc:Get_Workers_Request xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v42.0">
77+
<bsvc:Request_References bsvc:Skip_Non_Existing_Instances="false" bsvc:Ignore_Invalid_References="true">
78+
<bsvc:Worker_Reference bsvc:Descriptor="Employee_ID">
79+
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
80+
</bsvc:Worker_Reference>
81+
</bsvc:Request_References>
82+
<bsvc:Response_Filter>
83+
<bsvc:As_Of_Effective_Date>{As_Of_Effective_Date}</bsvc:As_Of_Effective_Date>
84+
</bsvc:Response_Filter>
85+
<bsvc:Response_Group>
86+
<bsvc:Include_Reference>true</bsvc:Include_Reference>
87+
<bsvc:Include_Personal_Information>false</bsvc:Include_Personal_Information>
88+
<bsvc:Include_Employment_Information>false</bsvc:Include_Employment_Information>
89+
<bsvc:Include_Organizations>false</bsvc:Include_Organizations>
90+
<bsvc:Include_Roles>false</bsvc:Include_Roles>
91+
<bsvc:Include_Management_Chain_Data>false</bsvc:Include_Management_Chain_Data>
92+
<bsvc:Include_Benefit_Enrollments>false</bsvc:Include_Benefit_Enrollments>
93+
<bsvc:Include_Benefit_Eligibility>false</bsvc:Include_Benefit_Eligibility>
94+
<bsvc:Include_Related_Persons>true</bsvc:Include_Related_Persons>
95+
<bsvc:Include_Qualifications>false</bsvc:Include_Qualifications>
96+
<bsvc:Include_Photo>false</bsvc:Include_Photo>
97+
<bsvc:Include_Worker_Documents>false</bsvc:Include_Worker_Documents>
98+
<bsvc:Include_Transaction_Log_Data>false</bsvc:Include_Transaction_Log_Data>
99+
<bsvc:Include_User_Account>false</bsvc:Include_User_Account>
100+
</bsvc:Response_Group>
101+
</bsvc:Get_Workers_Request>
102+
</requestTemplate>
103+
</requestTemplates>
104+
</workdayEntityConfigurationTemplate>

0 commit comments

Comments
 (0)