Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Workday Connector

Enterprise

The Workday Connector facilitates connections between Mule integration applications and Workday by allowing you to connect to a Workday database. It is a Standard connector, meaning that you can deploy it into production if you have an Mule Enterprise license or an Anypoint Platform account.

The Workday Connector provides access to 13 different modules in the Workday database. It allows you to perform a large set of actions for each module, including inserting, querying, and deleting elements.

This document describes implementation examples within the context of Anypoint Studio, Mule’s graphical user interface, and, in parallel, includes configuration details for doing the same in the XML Editor.

Installing the Connector in Studio

You can install a connector in Anypoint Studio using the instructions in Installing a Connector from Anypoint Exchange.

However, to use the Workday Connector in a production environment, you must have either:

  • An Enterprise license to use Mule 

  • A CloudHub Starter, Professional, or Enterprise account

Contact the MuleSoft Sales Team to obtain either of these. (Read more about Installing an Enterprise License.)

Click Restart Now to complete the installation. Once you have installed the connector and restarted Studio you can see several new message processors available in the palette, all under the Connectors category.

workday-module-list

Alternatively you can also install this extension via Maven.

Configuring the Workday Human Resource Connector

All of the examples on this document focuses on the Workday Human Resource message processor.

To use the Workday Connector, you must configure two things:

  • The instance of the connector in your application

  • A global Workday Human Resource connector configuration

To create a global Workday Human Resource connector configuration, follow these steps:

  1. Click the Global Elements tab at the base of the canvas, then click Create.

  2. Use the filter to locate, then select, Workday Human Resource, then click OK.

  3. Configure the global connector’s parameters according to the table below.

    GE1

    Parameter Description Example

    Name

    Name for the global element

    Workday_Human_Resource1

    User

    User for connecting to Workday. The username should follow this structure:
    userID@tenantID

    user1@mulesoft_pt1

    Password

    Password for connecting to Workday

     ********

    Endpoint

    URL where data server is hosted. It should follow this structure:

    https://{your Workday domain}/ccx/service/\{your tenant name}/\{desired Workday Service}/\{desired Workday Service Version}

    https://services1.workday.com/ccx/service/acme/Human_Resources/v1

    wsdl

    Workday WSDL location. This is not required for the connector to function properly.

     

  4. Access the Pooling Profile tab to configure any settings relevant to managing multiple connections via a connection pool.

  5. Access the Reconnection tab to configure any settings relevant to reconnection strategies that Mule should execute if it loses its connection to Workday.

  6. Click Test Connection to confirm that the parameters of your global Workday connector are accurate, and that Mule is able to successfully connect to your instance of Workday.

  7. Click OK to save the global connector configurations.

  8. Return to the Message Flow tab in Studio. Drag the Human Resource Connector onto the canvas, then select it to open the Properties Editor console.

  9. Configure the connector’s parameters according to the table below.

    Workday1

    Field Description Default

    Display Name

    The name with which the element will be displayed in your flow.

    Workday Human Resource

    Config Reference

    The global element linked to this connector. Global elements encapsulate reusable data about the connection to the DB.

     

    Operation

    The operation to perform.

    Add update organization

    Organization Find Reference

    A parameter that defines the query filter for the set of results.

    #[payload]

  10. Click blank space on the canvas to save your Workday connector configurations.

Example Use Case 1:

Note: Get the first 100 workers in your company and create a CSV file for them.  

As a recruiter, I want to get a partial list of employees in my company and export the list to a file.

  1. Drag an HTTP Endpoint into a new flow, and configure it with the following parameters:

    Property Value

    Host

    localhost

    Path

    getWorker

    HTTP-general HTTP-GE

    To set the host for the HTTP connector, you need to add a connector configuration. Click the plus sign (+) next to Connector Configuration (outlined above) to display the global element properties for the HTTP connector. Then, set the value of the Host field to localhost.

    The new flow is now reachable through the path http://localhost:8081/getWorker.

  2. Add a Groovy transformer after the HTTP endpoint to deal with the message payload.

  3. Add the following code into the Groovy transformer. This groovy script constructs the SOAP request to get workers out of Workday.

    
           
                    
                 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    // instantiate a new getworkerrequest object
    com.workday.hr.GetWorkersRequestType getWorkersType = new com.workday.hr.GetWorkersRequestType();
     
    //OPTIONAL instantiate a responsefilter object to set page number
    com.workday.hr.ResponseFilterType responseFilterType = new com.workday.hr.ResponseFilterType();
    //Set the page number
    responseFilterType.setPage(1);
    //set the response filter in the worker object
    getWorkersType.setResponseFilter(responseFilterType);
     
    //return the getworkerrequest object as the message payload
    return getWorkersType;
  4. Drag a Workday Human Resource connector into the flow.
    workdayFlow1

  5. Add a new Global element by clicking on the plus sign next to the Connector Configuration field.

    wd2

  6. Configure this Global Element according to the table below (Refer to [Configuring the Workday Human Resource Connector] for more details).

    WorkdayGEProps

    Property Description

    Name

    A unique name for this global element to be referenced by connectors

    user

    User for connecting to Workday, formatted as <user>@<Tenant ID>

    password

    Workday password

    endpoint

    URL of your Workday server, in the form https://<Workday domain>/ccx/service/<your tenant name</<desired Workday Service>/<desired Workday Service Version> (for example, https://services1.workday.com/ccx/service/acme/Human_Resources/v1).

  7. Back in the properties editor of the Workday Human Resource connector in your application, configure the remaining parameters according to the table below.

    Field Value

    Display Name

    Workday Human Resource

    Config Reference

    Workday_Human_Resource (the name of the global element you created)

    Operation

    Get workers

    Workers Request Reference

    Leave the default #[payload]

    wd3

  8. Add a DataMapper transformer, then configure it as per the steps listed below.

    1. For the input type, select Connector. The fields should be automatically populated with the following:

      Property Value

      Connector

      Workday_Human_Resource

      Operation

      get-workers

      Object

      GetWorkersResponseType

    2. For the output type, select CSV, then User Defined. Click Create/Edit Structure…​ to specify the following data structure for the output file:

      Variable Type

      UserID

      String

      Name

      String

      Title

      String

    3. Once you have defined both input and output, click Create Mapping.

    4. In the response data provided by the connector (listed in DataMapper’s Input pane) find the worker element, then drag it to the output root node as shown below. This will create a new Element Mapping.

      worker+element

    5. Find the input data fields of the worker that you want to map to your CSV output file. Drag each input data field to its corresponding output CSV field.

      DM

  9. Add a File Endpoint at the end of your flow to output the payload to a CSV file.
      workdayFlow1-final_stage

    Configure the File Endpoint as shown below.

    Property Value

    Display Name

    File

    Path

    <desired path to create files in>

    Output Pattern

    <desired filename>

  10. Run the project as a Mule application.

  11. From a browser, navigate to http://localhost:8081/getWorker.

  12. Mule performs the query, produces a CSV file with a list of contacts matching the query criteria, and inserts the file in the output folder you specified.

  1. Add a wd-hr:config global element to your project, then configure its attributes and child elements according to the table below (see code below for a complete sample).

    
           
                    
                 
    1
    2
    3
    
    &lt;wd-hr:config name="Workday_Human_Resource" doc:name="Workday Human Resource" hrUser="&lt;your user name&gt;" hrPassword="&lt;your password&gt;" hrEndpoint="&lt;your server&gt;"&gt;
            &lt;wd-hr:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/&gt;
    &lt;/wd-hr:config&gt;
    Attribute Value

    name

    Workday_Human_Resource

    doc:name

    Workday Human Resource

    objectManager

    EAIObjMgr_enu

    hrPassword

    <your password>

    hrEndpoint

    <your server>

    hrUser

    <your username>

    Child Element

    wd-hr:connection-pooling-profile

    Child Element Attribute Value

    initialisationPolicy

    INITIALISE_ONE

    exhaustedAction

    WHEN_EXHAUSTED_GROW

  2. Create a Mule flow with an HTTP endpoint, configuring the endpoint according to the table below (see code below for a complete sample).

    
           
                    
                 
    1
    2
    3
    
    &lt;flow name="workdayFlow1"doc:name="workdayFlow1"&gt;
        &lt;http:inbound-endpoint exchange-pattern="one-way"host="localhost"port="8081"path="getWorker"doc:name="HTTP"/&gt;
    &lt;/flow&gt;
    Attribute Value

    exchange-pattern

    one-way

    host

    localhost

    port

    8081

    path

    getWorker

    doc:name

    HTTP

    The new flow is now reachable through the path http://localhost:8081/getWorker. As the exchange pattern is set to one-way, no response message is returned to the requester.

  3. After the HTTP endpoint, add Groovy transformer:

    
           
                    
                 
    1
    2
    3
    4
    
    &lt;scripting:transformer doc:name="Groovy"&gt;
        &lt;scripting:script engine="Groovy"&gt;
        &lt;/scripting:script&gt;
    &lt;/scripting:transformer&gt;

    Include the following code inside the Groovy transformer:

    
           
                    
                 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    //This groovy script constructs the SOAP request to get workers out of workday
     
    // instantiate a new getworkerrequest object
    com.workday.hr.GetWorkersRequestType getWorkersType = new com.workday.hr.GetWorkersRequestType();
     
    //OPTIONAL instantiate a responsefilter object to set page number
    com.workday.hr.ResponseFilterType responseFilterType = new com.workday.hr.ResponseFilterType();
    //Set the page number
    responseFilterType.setPage(1);
    //set the response filter in the worker object
    getWorkersType.setResponseFilter(responseFilterType);
     
    //return the getworkerrequest object as the message payload
    return getWorkersType;

    The end result should look like this:

    
           
                    
                 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    &lt;scripting:transformer doc:name="Groovy"&gt;
        &lt;scripting:script engine="Groovy"&gt;&lt;![CDATA[//This groovy script constructs the SOAP request to get workers out of workday
    // instantiate a new getworkerrequest object
    com.workday.hr.GetWorkersRequestType getWorkersType = new com.workday.hr.GetWorkersRequestType();
    //OPTIONAL instantiate a responsefilter object to set page number
    com.workday.hr.ResponseFilterType responseFilterType = new com.workday.hr.ResponseFilterType();
    //Set the page number
    responseFilterType.setPage(1);
    //set the response filter in the worker object
    getWorkersType.setResponseFilter(responseFilterType);
    //return the getworkerrequest object as the message payload
    return getWorkersType;
     
    ]]&gt;
        &lt;/scripting:script&gt;
    &lt;/scripting:transformer&gt;
  4. After the Groovy transformer, add a wd-hr:get-workers element to your flow, configuring the attributes according to the table below.

    Property Value

    doc:name

    Workday Human Resource

    config-ref

    Workday_Human_Resource

    The config-ref links this connector to the global element you created at the beginning of this example.

  5. Add a DataMapper element.

    
           
                    
                 
    1
    
    &lt;data-mapper:config name="new_mapping_grf" transformationGraphPath="new_mapping.grf" doc:name="DataMapper"/&gt;

    You must configure the DataMapper element through Studio’s Visual Editor. Switch the view to Studio’s Message Flow view, then click the DataMapper element to set its properties.

    1. For the input type, select Connector. The fields should be automatically populated with the following:

      Property Value

      Connector

      Workday_Human_Resource

      Operation

      get-workers

      Object

      GetWorkersResponseType

    2. For the output type, select CSV, then User Defined. Click Edit Fields to specify the following data structure for the output file.

      Variable Type

      UserID

      String

      Name

      String

      Title

      String

    3. Once you have defined both input and output, click Create Mapping

    4. In the response data provided by the connector (listed in DataMapper’s Input pane) find the worker element, then drag it to the output root node as shown below. This will create a new Element Mapping.

      worker+element

    5. Find the input data fields of the worker that you want to map to your CSV output file. Drag each input data field to its corresponding output CSV field.

      DM

  6. Add a file:outbound-endpoint in the flow after the DataMapper to output the payload into a CSV file. Configure its attributes according to the table below.

    
           
                    
                 
    1
    
    &lt;file:outbound-endpoint path="/Users/mulesoft/AnypointStudio/workspace/workday/testfiles" responseTimeout="10000" doc:name="File"/&gt;
    Attribute Value

    path

    location in which you wish to capture the CSV file the application produces

    responseTimeout

    10000

    doc:name

    File

  7. Run the project as a Mule Application.

  8. From a browser, navigate to http://localhost:8081/getWorker .

  9. Mule conducts the query, produces a CSV file with a list workers, and inserts the file in the output folder you specified.

Example Code

Keep in mind that for this example to work, you must manually configure the following values of the global Workday HR connector (wd-hr:config element):

  • hrUser

  • hrPassword

  • hrEndpoint

Moreover, adjust the filepath configuration to match a valid path on your local system and note that the DataMapper component must be configured manually using Studio’s Visual Editor.


           
        
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
<mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:wd-hr="http://www.mulesoft.org/schema/mule/wd-hr" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
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/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/wd-hr http://www.mulesoft.org/schema/mule/wd-hr/current/mule-wd-hr.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
    <wd-hr:config name="Workday_Human_Resource" hrUser="" hrPassword="" hrEndpoint="" doc:name="Workday Human Resource">
        <wd-hr:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
    </wd-hr:config>
    <data-mapper:config name="getworkersresponsetype_to_csv" transformationGraphPath="getworkersresponsetype_to_csv.grf" doc:name="getworkersresponsetype_to_csv"/>
  
    <flow name="workdayFlow1" doc:name="workdayFlow1">
    <http:inbound-endpoint host="localhost" port="8081" path="getWorker" />
     <scripting:transformer doc:name="Groovy">
            <scripting:script engine="Groovy">
                <![CDATA[
  
//This groovy script constructs the SOAP request to get workers out of workday
// instantiate a new getworkerrequest object
com.workday.hr.GetWorkersRequestType getWorkersType = new com.workday.hr.GetWorkersRequestType();
//OPTIONAL instantiate a responsefilter object to set page number
com.workday.hr.ResponseFilterType responseFilterType = new com.workday.hr.ResponseFilterType();
//Set the page number
responseFilterType.setPage(1);
//set the response filter in the worker object
getWorkersType.setResponseFilter(responseFilterType);
//return the getworkerrequest object as the message payload
return getWorkersType;
  
                ]]>
            </scripting:script>         </scripting:transformer>
        <wd-hr:get-workers config-ref="Workday_Human_Resource"  doc:name="Workday Human Resource"/>
        <data-mapper:transform config-ref="getworkersresponsetype_to_csv" doc:name="DataMapper"/>
        <file:outbound-endpoint path="/Users/mulesoft/Documents/connectors/workday/output" outputPattern="workers.csv" responseTimeout="10000" doc:name="File"/>
    </flow> </mule>