Contact Free trial Login

Workday Examples - Mule 4

Anypoint Connector for Workday provides two financial management services examples that enable you to see how Workday Connector works in Anypoint Design Center’s Flow Designer.

Add a Fund to the Financial Management Service

This example uses the Invoke operation in the connector to insert a fund in the financial management service. You need access to Workday and your Workday user name, password, and tenant name to complete this example.

  1. In Design Center, click Create.

  2. Click Create new application to open Flow Designer.

  3. Specify a value for Project name, and click Create.

  4. In Let’s get started, select HTTP Connector and Listener.

  5. Click Next.

  6. For the target, search for "Workday" and select Workday Connector.

  7. In Operation, search for "fin" and select Financial Management.

  8. Click Done.

  9. In HTTP Listener, specify Path as a forward slash (/).

  10. Click the Transform card and click Script at the bottom of the card.

  11. Copy the following example and paste it into Transformation script:

    %dw 2.0
    output application/xml
    ns ns0 urn:com.workday/bsvc
    ---
    {
      ns0#Put_Fund_Request @(ns0#Add_Only: true, ns0#version: "v32.1"): {
        ns0#Fund_Data: {
          ns0#Fund_Name: "I.M.F",
          ns0#Fund_Type_Reference: {
            ns0#ID @(ns0#'type': 'Fund_Type_ID'): "FUND_TYPE-6-3"
          }
        }
      }
    }
  12. In the Workday component, specify Operation as Put_Fund.

  13. Select Click here to set it up.

    Configuration example:

    • Configuration Name: My Workday Connection

    • Connection: Basic Authentication Api V32

    • Username: <my_workday_username>

    • Password: <my_workday_password>

    • Tenant Name: <my_workday_tenant_name>

    • Host Name: Defaults to impl-cc.workday.com

  14. Click Test to ensure your user name, password, and tenant name are correct in Workday.

  15. Click Save.

  16. Click + and, in Select a component, select Logger.

  17. Set Message to payload (or #[payload]).

  18. Click Test at the right of the taskbar.

  19. After the test is successful, click the down-arrow menu in the taskbar and select Deploy application.

  20. After the project is running, check for a response.

  21. Click your browser’s back button to return to the list of Design Center projects.

  22. Click the Project Type entry for your project to expand the Details menu on the right side, note the Deployment url value.

  23. In a browser, add the deployment URL to http://<Deployment_URL>:8081/fund and copy the URL to the address bar.

    You receive an XML response similar to:

    <wd:Put_Fund_Response xmlns:wd="urn:com.workday/bsvc" wd:version="v32.1">
        <wd:Fund_Reference wd:Descriptor="I.M.F">
            <wd:ID wd:type="WID">THE_WID_ID_NUMBER</wd:ID>
            <wd:ID wd:type="Fund_ID">FUND-6-399</wd:ID>
        </wd:Fund_Reference>
    </wd:Put_Fund_Response>

Create a Position Request

A financial position shows the current balances for assets, liabilities, and equity in an organization. This example builds on Add a Fund to the Financial Management Service for its use of Design Center to enable you to create an app project that makes a Workday position request:

  1. Create a Mule application in Design Center.

  2. Add and configure an HTTP Listener as a trigger for your flow.

  3. Set Path to /create_position and use the default configuration for the Listener connection.

  4. Add Transform, the Dataweave component to your flow.

  5. Provide this transformation script to DataWeave:

    %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: "2019-07-06",
            ns0#Earliest_Hire_Date: "2019-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
            }
          }
        }
      }
    }
  6. Select the connector.

  7. Select the web service and the operation with content. In this example the content is the payload.

    Ensure 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.

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

    • Configuration Name: My Workday Config

    • Connection: Basic Authentication Api V32

    • Username: my_user_name

    • Password: my_password

    • Tenant Name: my_tenant_name

    • Host Name: impl-cc.workday.com

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

  9. Add Logger to your flow and set payload as the message.

  10. Deploy, sync, or run the app.

  11. To test the app, open http://<Deployment_url>:8081/create_position from a browser or from an app such as curl.

    The response should look like:

    <wd:Create_Position_Response xmlns:wd="urn:com.workday/bsvc" wd:version="v32.1">
      <wd:Event_Reference>
      <wd:ID wd:type="WID">WID_VALUE</wd:ID>
      </wd:Event_Reference>
      <wd:Position_Reference>
        <wd:ID wd:type="WID">WID_VALUE</wd:ID>
        <wd:ID wd:type="Position_ID">P-11158</wd:ID>
      </wd:Position_Reference>
    </wd:Create_Position_Response>

    The Logger displays this message:

    {Create_Position_Response={Event_Reference={ID=WID_VALUE}, Position_Reference={ID=P-11158}}}

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.