Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

To Use Workday in Anypoint Studio

You can use this connector in Anypoint Studio by adding it as a dependency in your Mule application.

Install Connector in Studio

  1. Open your Mule project in Anypoint Studio.

  2. Add the connector as a dependency in the pom.xml file:

<dependency>
  <groupId>org.mule.connectors</groupId>
  <artifactId>mule-workday-connector</artifactId>
  <version>9.0.0</version>
</dependency>

Configure in Studio 7

  1. Drag and drop the connector to the Studio Canvas.

  2. Configure the Global element for the connector

    Field Description

    Username

    Enter the username to log in with.

    Password

    Enter the corresponding password.

    Tenant Name

    Enter the Workday Tenant ID. It usually has the suffix "pt_1" appended to it, such as "acme_pt1".

    Host Name

    Enter the host name of one of Workday’s Cloud Servers. Default value: impl-cc.workday.com.

    Custom Transport

    Connection Idle Timeout and Response Timeout, and set up a proxy connection.

Use Case: Studio

Get Workday Incident Table Keys

Create a Mule flow to get keys from the Incident table in your Workday instance.

  1. Create a new Mule Application on your Studio and select an HTTP Listener as a Source in the new flow.

  2. Add a new HTTP Listener Configuration global element:

    1. Fill Host and port parameters with the following values:

      Parameter Value

      Host

      0.0.0.0

      Port

      8081

    2. Click Save.

  3. Assign your new Global configuration to your HTTP Listener.

  4. Fill in HTTP Listener path with /incident/get value.

  5. Drag and drop a new Workday component on the flow.

  6. Configure the Workday connector global element with its environment values under General tab.

  7. Add a transform message before the Connector and add an output like this:

    
                 
              
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    
    %dw 2.0
    output application/xml
    ns ns0 urn:com.workday/bsvc
    ---
    {
            ns0#Put_Applicant_Request @(ns0#version: "v28.0"): {
                    ns0#Applicant_Data: {
                            ns0#Personal_Data: {
                                    ns0#Name_Data: {
                                            ns0#Legal_Name_Data: {
                                                    ns0#Name_Detail_Data: {
                                                            ns0#Country_Reference: {
                                                                    ns0#ID @(ns0#"type": "ISO_3166-1_Alpha-2_Code"): payload.countryIDValue
                                                            },
                                                            ns0#First_Name: payload.firstName,
                                                            ns0#Last_Name: payload.lastName
                                                    }
                                            }
                                    },
                                    ns0#Contact_Data: {
                                            ns0#Email_Address_Data: {
                                                    ns0#Email_Address: payload.email,
                                                    ns0#Usage_Data @(ns0#Public: true): {
                                                            ns0#Type_Data @(ns0#Primary: true): {
                                                                    ns0#Type_Reference: {
                                                                            ns0#ID @(ns0#"type": "Communication_Usage_Type_ID"): "Home"
                                                                    }
                                                            }
                                                    }
                                            }
                                    }
                            },
                            ns0#Recruiting_Data: {
                                    ns0#Ineligible_for_Hire: false,
                                    ns0#Positions_Considered_for_Reference: {
                                            ns0#ID @(ns0#"type": "Position_ID"): payload.applicantPositionIDValue
                                    }
                            },
                            ns0#Background_Check_Data: {
                                    ns0#Status_Date: payload.statusDate,
                                    ns0#Status_Reference: {
                                            ns0#ID @(ns0#"type": "Background_Check_Status_ID"): payload.backgroundCheckStatusIDValue
                                    }
                            }
                    }
            }
    }
  8. Save and run the project as a Mule Application.

  9. To test the app, navigate to http://127.0.0.1:8081/incident/get

Use Case: XML


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:workday="http://www.mulesoft.org/schema/mule/workday" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
        xmlns:http="http://www.mulesoft.org/schema/mule/http"
        xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/workday http://www.mulesoft.org/schema/mule/workday/current/mule-workday.xsd">
        <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="47ffb091-e6c8-4f12-a8d3-6abf609f1c1a" >
                <http:listener-connection host="0.0.0.0" port="8081" />
        </http:listener-config>
        <configuration-properties file="mule-app.properties"/>
        <workday:config name="Workday_Config" doc:name="Workday Config" doc:id="392b0328-41f3-40a7-8f85-4b53471ec4d2" >
                <workday:basic-connection username="${workday.username}" password="${workday.password}" tenantName="${workday.tenantName}" hostName="${workday.hostName}">
                        <workday:transport >
                                <workday:default-http-message-dispatcher-provider />
                        </workday:transport>
                </workday:basic-connection>
        </workday:config>
        <flow name="payroll-gbr-get-form" doc:id="713bc3e9-1752-433f-b2d8-afb4d59c3e66" >
                <http:listener config-ref="HTTP_Listener_config" path="/" doc:name="/" doc:id="a4769708-a7b3-40b4-961c-6104ac02d612" />
                <parse-template location="form.html" doc:name="Parse Template" doc:id="be0f09df-04d1-4fc4-a068-123800676de8" />
        </flow>
        <flow name="create-position" doc:id="c61dfb65-2a60-48b6-b9e5-deaf79da7b94" >
                <http:listener config-ref="HTTP_Listener_config" path="/create-position" doc:name="/create-position" doc:id="e2bfe765-5136-4605-a6ea-2709656a47e5" />
                <logger level="INFO" doc:name="Logger" doc:id="ae9dac6f-fed2-4571-ba17-0ee47006d690" />
                <ee:transform doc:name="Transform Message" doc:id="d1688064-f089-46de-9060-7f94d66babd6" >
                        <ee:message >
                                <ee:set-payload ><![CDATA[%dw 2.0
output application/xml
ns ns0 urn:com.workday/bsvc
---
{
        ns0#Create_Position_Request @(ns0#version: "v28.0"): {
                ns0#Business_Process_Parameters: {
                        ns0#Auto_Complete: true,
                        ns0#Run_Now: true
                },
                ns0#Create_Position_Data: {
                        ns0#Supervisory_Organization_Reference: {
                                ns0#ID @(ns0#"type":"Organization_Reference_ID"): payload.organizationReferenceID
                        },
                        ns0#Position_Data: {
                                ns0#Job_Posting_Title: payload.jobPostingTitle
                        },
                        ns0#Position_Group_Restrictions_Data: {
                                ns0#Availability_Date: payload.availabilityDate,
                                ns0#Earliest_Hire_Date: payload.earliestHireDate
                        },
                        ns0#Edit_Assign_Organization_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },
                        ns0#Request_Default_Compensation_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },

                        ns0#Assign_Pay_Group_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },
                        ns0#Assign_Costing_Allocation_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        }
                }
        }
}]]></ee:set-payload>
        </ee:message>
        <ee:variables >
        <ee:set-variable variableName="myPayload" ><![CDATA[%dw 2.0
output application/xml
ns ns0 urn:com.workday/bsvc
---
{
        ns0#Create_Position_Request @(ns0#version: "v28.0"): {
                ns0#Business_Process_Parameters: {
                        ns0#Auto_Complete: true,
                        ns0#Run_Now: true
                },
                ns0#Create_Position_Data: {
                        ns0#Supervisory_Organization_Reference: {
                                ns0#ID @(ns0#"type":"Organization_Reference_ID"): payload.organizationReferenceID
                        },
                        ns0#Position_Data: {
                                ns0#Job_Posting_Title: payload.jobPostingTitle
                        },
                        ns0#Position_Group_Restrictions_Data: {
                                ns0#Availability_Date: payload.availabilityDate,
                                ns0#Earliest_Hire_Date: payload.earliestHireDate
                        },
                        ns0#Edit_Assign_Organization_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },
                        ns0#Request_Default_Compensation_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },

                        ns0#Assign_Pay_Group_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        },
                        ns0#Assign_Costing_Allocation_Sub_Process: {
                                ns0#Business_Sub_Process_Parameters: {
                                        ns0#Skip: true
                                }
                        }
                }
        }
}]]></ee:set-variable>
                        </ee:variables>
                </ee:transform>
                <workday:invoke config-ref="Workday_Config" doc:name="Staffing-Create_Position" doc:id="f5feef4c-3975-45d3-bb86-c1069e8b3299" service="Staffing" operation="Create_Position">
                        <workday:message >
                                <workday:body ><![CDATA[#[vars.myPayload]]]></workday:body>
                        </workday:message>
                </workday:invoke>
                <ee:transform doc:name="Transform Message" doc:id="b79cdf0a-0b40-4dc2-9ab8-161b2bda39b3" >
                        <ee:message >
                                <ee:set-payload ><![CDATA[%dw 2.0
output application/json
ns ns0 urn:com.workday/bsvc
---
{
        ID: payload.body.Create_Position_Response.Position_Reference[1]
}]]></ee:set-payload>
                        </ee:message>
                </ee:transform>
                <logger level="INFO" doc:name="Logger" doc:id="25f5342a-19cb-4d37-9977-ee8ab1f000b1" />
        </flow>
</mule>