Requirements
An organization’s employee journey will involve a number of events, some of which need to be updated in various systems within the company.
Workday will notify downstream systems, such as D365, DocuSign, and Salesforce, of events such as: ON_BOARDING
, OFF_BOARDING
, DEPARTMENT_CHANGE
, OFFICE_LOCATION
, MANAGER_CHANGE
, and INDIVIDUAL_LEAVE
.
Some of the events on the list are necessary for particular downstream systems, while others are not. Here, learn how to design a flow that can guarantee 100% delivery to the necessary systems.
Generic Data Model
A generic data model is as follows:
- A set of data that can be reused across systems for various reasons
- It offers relation types that are standardized.
- Any object can be classified using generic data models, and part-whole relations can be specified for any object
- An infinite number of facts can be expressed by generic data models
Dynamic Data Model
Consistency within an organization can be ensured by sharing dynamic data between platforms and departments. A flexible data structure is one that doesn’t have to be predefined in a strict schema and can change to accommodate evolving needs or data kinds.
Workday Events
Workday can generate a number of events related to an employee. For example, ON_BOARDING
, OFF_BOARDING
, DEPARTMENT_CHANGE
, OFFICE_LOCATION
, MANAGER_CHANGE
, INDIVIDUAL_LEAVE
, etc.
Based on downstream system requirements (i.e., D365, DocuSign, Salesforce), they can adapt all the events or part of the events.
To design a generic, dynamic, simple, and easily adaptable data model, workday publishes events with the same message structure:
action
companyCode
employeeId
email
customField1
,customField2
, etc.
Event Data Model
Examples
Onboarding Event
{
"action": "ON_BOARDING",
"companyCode": "ANKURAN",
"employeeId": "ABC125",
"email": "bhuyan@ankur-online.com",
"customField1": {
"Name": "firstName",
"Value": "Ankur"
},
"customField2": {
"Name": "lastName",
"Value": "Bhuyan"
},
"customField3": {
"Name": "status",
"Value": "Active"
}
}
Offboarding Event
{
"action": "OFF_BOARDING",
"companyCode": "ANKURAN",
"employeeId": "ABC125",
"email": "bhuyan@ankur-online.com",
"customField1": {
"Name": "status",
"Value": "Close"
},
"customField2": {
"Name": "terminationDate",
"Value": "21-08-2024"
}
}
Individual Leave
{
"action": "INDIVIDUAL_LEAVE",
"companyCode": "ANKURAN",
"employeeId": "ABC125",
"email": "bhuyan@ankur-online.com",
"customField1": {
"Name": "managerId",
"Value": "XYZ123"
},
"customField2": {
"Name": "managerEmail",
"Value": "manager@ankur-online.com"
},
"customField3": {
"Name": "leaveType",
"Value": "private"
},
"customField4": {
"Name": "effectiveDate",
"Value": "21-08-2024"
},
"customField5": {
"Name": "durationInHour",
"Value": "8"
}
}
Solution Design
Workday Experience API
Capture the "action"
from workday input data and add as anypoint-mq:properties
along with "correlationId"
while publishing.
<sub-flow name="update-user" doc:id="3e7ee53b-be64-45e9-93c8-c2fc1cf71a52">
<ee:transform doc:name="Prepare request parameter" doc:id="3ed4576c-6234-4053-b23e-c80a3733d53e" >
<ee:variables >
<ee:set-variable variableName="userProperties" >
<![CDATA[%dw 2.0
output application/java
---
{
"correlationId" : vars.baselogger.correlationId default "",
"action" : payload.action default ""
}]]>
</ee:set-variable>
</ee:variables>
</ee:transform>
<logger level="INFO" doc:name="INFO : Published data" doc:id="33b3a36c-4cce-4133-885d-fa90e5265318" message="Published data : #[payload]"/>
<logger level="INFO" doc:name="INFO : Published user properties" doc:id="82252294-19a3-4bdb-af58-b0409348198d" message="Published user properties : #[vars.userProperties]"/>
<anypoint-mq:publish doc:name="Publish to X-USER-DEACTIVATE" doc:id="8fd1aebc-93e8-4d30-a77a-4dae339f7d27" config-ref="Anypoint_MQ_Config" destination="${anypoint.exchange}">
<anypoint-mq:body >
<![CDATA[#[%dw 2.0
output application/json
---
payload]]]>
</anypoint-mq:body>
<anypoint-mq:properties >
<![CDATA[#[vars.userProperties]]]>
</anypoint-mq:properties>
</anypoint-mq:publish>
</sub-flow>
Anypoint MQ Exchange Configuration
Configure the routing rules based on user properties. For example: action
.
Based on configured rules the data will be filtered/routed to respective downstream systems.
Matcher Configuration
Property Type: String
Equals
: The value in this rule exactly matches the value in the message property.Prefix
: The value in this rule is the first value in the message property.Any of
: Any of the values in this rule correspond to the value of the message property.None of
: None of the values in this rule correspond to the value of the message property.Exists
: A property in the message has the same name as the property in this rule.
Property Type: Number
Equals
: The value in this rule is equivalent to the value of the message property.Less than
: The value in the message property is lower than the value in this rule.Less than or equal
: The value in the message property is lower than or equal to the value in this rule.Greater than
: The value in the message property is greater than the value in this rule.Greater than or equal
: The value in the message property is greater than or equal to the value in this rule.Range
: The value of the message property falls into the range of values allowed by this rule.None of
: None of the values in this rule correspond to the value of the message property.Exists
: A property in the message has the same name as the property in this rule.
Conclusion
The purpose of this article is to demonstrate the definition of a generic and dynamic data model that can be used for various publisher-generated events. Both the source and destination systems must agree on the specified data model in order to implement this strategy.
Adopting this event-driven strategy can be simple, and the organization’s development effort can be decreased without relying on one another.
Recognize how to configure rules on message exchanges in Anypoint MQ to route messages.