Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

Example: To Make a Position Request in Workday

This example creates Mule flow that makes a Workday position request.

  1. Create a Mule application as a project.

  2. Add and configure an HTTP Listener as a trigger for your flow, and set a Path such as this one:

    /create_position

    You can use the default configuration for the Listener connection.

  3. After the HTTP Listener, add the Invoke operation from the Workday connector to your flow.

  4. Set up, test, and save a Workday configuration for the connection to the Workday server, for example:

    • Configuration Name: My Workday Config

    • Username: my_user_name

    • Password: my_password

    • Tenant Name: my_tenant_name

    • Host Name: impl-cc.workday.com

      If the connection test is unsuccessful, you should correct any invalid connection parameters and then retest the connection.

  5. Select the Web Service Configuration values for the Workday connector, for example:

    • Service: Staffing

    • Operation: Create_Position

      You need to make sure that the values are available as menu items in the Service and Operation fields. The names become available once the connector loads the metadata for them. Do not type the names manually.

  6. Provide a transformation script for the connector.

    In your Invoke operation in Design Center, you click the Map button for the Body, then click the Script tab at the bottom of the Body window, and paste a Transformation script like this one:

    %dw 2.0
    
    ns ns0 urn:com.workday/bsvc
    
    
    output application/xml
    ---
    {
      ns0#Create_Position_Request: {
        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"): "SUPERVISORY_ORGANIZATION-6-226"
          },
          ns0#Position_Data: {
            ns0#Job_Posting_Title: "General Manager"
          },
          ns0#Position_Group_Restrictions_Data: {
            ns0#Availability_Date: "2017-07-06",
            ns0#Earliest_Hire_Date: "2017-07-08"
          },
          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
            }
          }
        }
      }
    }

    Note that this example changes the output data type to application/xml.

  7. Add a Logger to the end of your flow that takes payload as the message.

  8. Deploy, Sync, or Run the app.

  9. To test the app, open http://url.for.your.app:8081/create_position from a browser or from an app such as Postman.

    The response should look something like this:

    <wd:Create_Position_Response xmlns:wd="urn:com.workday/bsvc" wd:version="v28.0">
      <wd:Event_Reference>
      <wd:ID wd:type="WID">3cacb7ed3b2101980a03da33b32afe63</wd:ID>
      </wd:Event_Reference>
      <wd:Position_Reference>
        <wd:ID wd:type="WID">3cacb7ed3b210131334ede33b32a0664</wd:ID>
        <wd:ID wd:type="Position_ID">P-11158</wd:ID>
      </wd:Position_Reference>
    </wd:Create_Position_Response>

    The Logger produces a message like this:

    {Create_Position_Response={Event_Reference={ID=3cacb7ed3b2101980a03da33b32afe63}, Position_Reference={ID=P-11158}}}

In this topic: