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

Workday Connector 5.0

Select

The Anypoint Connector for Workday is a closed source Enterprise connector which provides a connection between Workday and third party software. It interfaces with the Human Capital Management, Financial Management, Student, and System web services.

Reference: Workday Connector

Prerequisites

This document assumes that you are familiar with Workday API. To use the this connector, you need:

  • A Workday instance with requisite permission

  • A set of valid credentials, including the required Workday endpoints, pointing to your Workday instance.

This document also assumes that you are familiar with Mule, Anypoint Connectors, and the Anypoint Studio interface. To increase your familiarity with Studio, consider completing one or more Anypoint Studio Tutorials. Further, this page assumes that you have a basic understanding of Mule flows and Mule Global Elements. This document describes implementation examples within the context of the Anypoint Studio Visual Editor and includes configuration details for doing the same in the XML Editor.

Compatibility

The Workday connector 5.0 is compatible with:

Application/Service Version

Workday API

v24.0

Mule Runtime

Enterprise Edition 3.5.0 and later

Java

JDK 7

Installing and Configuring

Installing

You can install a connector in Anypoint Studio using the instructions in To Install 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.

Click Restart Now to complete the installation. After you install the connector and restart Studio, you can see several new message processors available in the palette, all under the Connectors category.

wd_palette

Alternatively you can also install this extension via Maven.

Updating from an Older Version

When a new version of a connector is released, Anypoint studio displays a popup in the bottom right corner of your screen with the following message: Updates Available.

To upgrade to the newer version of the Workday connector:

  1. Click the popup and check for the available updates.

  2. Install the individual Workday connectors from the update site.

  3. Ensure that the maven dependencies have been updated correctly from mule-module-workday to mule-module-workday-<wd_module_name>.

    Make sure you update flows that are using Phased Out or Deprecated operations.
  4. Follow the instructions provided by the user interface.

  5. Restart Studio when prompted.

After restarting, if you have several versions of the connector installed, Mule asks you for the version of the connector you like to use.

Creating a New Project

  1. In Studio, click File > New > Mule Project.

    filenew

  2. Enter a name for your new project and leave the remaining options with their default values.

  3. If you plan to use Git, select Create a .gitignore file for the project with default ignores for Studio Projects, and then click Next.

  4. Click Finish to create the project.

Configuring the Workday Connector Global Element

To use the Workday connector in your Mule application, you must configure a global element for each Workday connector module in the application (read more about global elements). To create a global Workday 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, one of the Workday connector configurations, then click OK. The example below uses the Workday Cash Management message processor.

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

    global_elements_1

    Parameter Description Example

    Name

    Name for the global element

    Workday_Cash_Management_Connection_Management

    Username

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

    user1@acme_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}

    wsdl

    Enter the WSDL Location property. This defaults to the WSDL found on the Workday Community website.

  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.

    The Workday connector v5.0 enables you to adjust the values for the Connection Timeout and the Receive Timeout of requests that are sent to Workday. The default value for both of these fields is 60000ms, which means that any requests that take longer than a minute throw an exception. You can override this behavior by setting their values to 0 so that the connector waits indefinitely until a request is successfully sent and a response is received.
  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. (Read more about Testing Connections.)

  7. Click OK to save the global connector configurations.

Setting up a Global Configuration with Proxy (Optional)

The Workday connector 5.0 supports the use of HTTP proxy servers. To setup the Global Configuration with Proxy:

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

  2. Use the filter to locate, then select, one of the Workday connector configurations, then click OK. The example below uses the Workday Cash Management message processor.

  3. Configure the global connector’s parameters.

    global_elements_2

  4. Under the Proxy Settings section, enter the Host address and Port number. If one of these fields is an input, the other must also be input.

  5. If your proxy server requires you to specify a username and password, you can fill these in the Username and Password fields. However, if your proxy server does not require a username and password, you can leave these fields empty.

Using the Connector

The Workday connector is an operation-based connector, which means that when you add the connector to your flow, you need to configure a specific operation the connector is intended to perform.

Adding the Workday Connector to a Flow

  1. Create a new Mule project in Anypoint Studio.

  2. Drag the relevant Workday message processor onto the canvas, then select it to open the properties editor. We use the Workday Cash Management connector for an example here.

  3. Configure the connector’s parameters:

    cash_management

    Field Description Default

    Display Name

    The name of the element in your flow.

    Workday Cash Management

    Config Reference

    The global element linked to this connector.

    Operation

    The operation to perform.

    Get financial institutions

    Get Financial Request Reference

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

    #[payload]

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

Example Use Case

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 connector 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 + icon 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 connector 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).

    global_elements_1

    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 creates 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:

    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 connector, configuring 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 connector, 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 creates 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 as follows:

    <file:outbound-endpoint path="/Users/mulesoft/AnypointStudio/workspace/workday/testfiles" responseTimeout="10000" doc:name="File"/>

    Attribute Value

    path

    The 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

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
43
<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"
    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>
#    <http:listener-config name="HTTP_Listener_Configuration"  host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
    <data-mapper:config name="getworkersresponsetype_to_csv" transformationGraphPath="getworkersresponsetype_to_csv.grf" doc:name="getworkersresponsetype_to_csv"/>

    <flow name="workdayFlow1" doc:name="workdayFlow1">
#       <http:listener config-ref="HTTP_Listener_Configuration" path="getWorker" doc:name="HTTP"/>
     <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>

See Also