Workday to Salesforce Sales Item - Product Migration

(0 reviews)

home

Moves a large set of sales items from Workday to Salesforce. You can trigger this manually or programmatically with an HTTP call.

Sales items are upserted so that the migration can be run multiple times without creating duplicate records. This template uses batch to efficiently process many records at a time.

28ae47e4-292f-4336-b06b-c335c49ab754-image.png

Workday Requirements

Install Workday Financials - Revenue Management module which you can find on the Workday connector page.

License Agreement

This template is subject to the conditions of the MuleSoft License Agreement. Review the terms of the license before downloading and using this template. You can use this template for free with the Mule Enterprise Edition, CloudHub, or as a trial in Anypoint Studio.

Use Case

As a Workday admin I want to migrate Sales Items to Salesforce Products.

This template serves as a foundation for the process of migrating sales items from Workday. As implemented, this template leverages the Mule batch module. The batch job is divided into Process and On Complete stages. Migration process starts by querying all existing sales items at Workday. In the Process stage, the template queries the Salesforce for already existing products based on the product names retrieved from Workday. The products are inserted or updated in the Salesforce system based on the results of these queries. Afterwards, the Salesforce system is queried for a pricebook entry, which belongs to the product. If a pricebook entry is found, it is updated, otherwise the pricebook entry for the product is created. Finally during the On Complete stage the template outputs statistics data in the console and sends a notification email with the results of the batch execution.

Considerations

There are certain pre-requisites that must be considered to run this template. All of them deal with the preparations in both source and destination systems, that must be made for the template to run smoothly. Failing to do so can lead to unexpected behavior of the template.

Salesforce Considerations

As a Data Destination

There are no considerations with using Salesforce as a data destination.

Workday Considerations

As a Data Source

There are no considerations with using Workday as a data origin.

Workday Financials Considerations

As a Data Source

There are no considerations with using Workday Financials as a data origin.

Run it!

Simple steps to get this template running.

Run On Premises

In this section we help you run this template on your computer.

Download Anypoint Studio and the Mule Runtime

If you are new to Mule, download this software:

Note: Anypoint Studio requires JDK 8.

Import a Template into Studio

In Studio, click the Exchange X icon in the upper left of the taskbar, log in with your Anypoint Platform credentials, search for the template, and click Open.

Run on Studio

After you import your template into Anypoint Studio, follow these steps to run it:

  1. Locate the properties file mule.dev.properties, in src/main/resources.
  2. Complete all the properties required per the examples in the "Properties to Configure" section.
  3. Right click the template project folder.
  4. Hover your mouse over Run as.
  5. Click Mule Application (configure).
  6. Inside the dialog, select Environment and set the variable mule.env to the value dev.
  7. Click Run.

Run on Mule Standalone

Update the properties in one of the property files, for example in mule.prod.properties, and run your app with a corresponding environment variable. In this example, use mule.env=prod.
After this, to trigger the use case, browse to the local HTTP connector with the port you configured in your file. If this is, for instance 9090, browse to: http://localhost:9090/migratesalesitems and this outputs a summary report and sends it in email.

Run on CloudHub

When creating your application in CloudHub, go to Runtime Manager > Manage Application > Properties to set the environment variables listed in "Properties to Configure" as well as the mule.env value.

Once your app is all set and started, if you choose as domain name wdayfsalesitemsmigration to trigger the use case you just need to browse to http://wdayfsalesitemsmigration.cloudhub.io/migratesalesitems and report is sent to the emails configured.

Deploy a Template in CloudHub

In Studio, right click your project name in Package Explorer and select Anypoint Platform > Deploy on CloudHub.

Properties to Configure

To use this template, configure properties such as credentials, configurations, etc.) in the properties file or in CloudHub from Runtime Manager > Manage Application > Properties. The sections that follow list example values.

Application Configuration

  • http.port 9090

Salesforce Connector Configuration

  • sfdc.username bob.dylan@orga
  • sfdc.password DylanPassword123
  • sfdc.securityToken avsfwCUl7apQs56Xq2AKi3X
  • sfdc.integration.pricebook2Id standard_pricebook2_id

Workday Connector Configuration

  • wday.user wdayf_user
  • wday.password wdayf_password
  • wday.tenant wday_tenant
  • wday.endpoint https://{your Workday domain}/ccx/service/{your tenant name}/Revenue_Management/v23.1

SMTP Services Configuration

  • smtp.host smtp.gmail.com
  • smtp.port 587
  • smtp.user gmail_user
  • smtp.password gmail_password

Email Details

  • mail.from batch.migratesalesitems.migration%40mulesoft.com
  • mail.to username@gmail.com
  • mail.subject Batch Job Finished Report

API Calls

Salesforce imposes limits on the number of API calls that can be made. Therefore calculating this amount may be an important factor to consider. The template calls to the API can be calculated using this formula:

  • 4 X * -- Where X is the number of sales items to synchronize on each run.

For instance if 10 records are fetched from origin instance, then 40 API calls are made (4 * 10).

Customize It!

This brief guide provides a high level understanding of how this template is built and how you can change it according to your needs. As Mule applications are based on XML files, this page describes the XML files used with this template. More files are available such as test classes and Mule application files, but to keep it simple, we focus on these XML files:

  • config.xml
  • businessLogic.xml
  • endpoints.xml
  • errorHandling.xml

config.xml

This file provides the configuration for connectors and configuration properties. Only change this file to make core changes to the connector processing logic. Otherwise, all parameters that can be modified should instead be in a properties file, which is the recommended place to make changes.

businessLogic.xml

The functional aspect of this template is implemented in this XML file, directed by a flow responsible for executing the logic. For the purpose of this template the mainFlow just executes a batch job that handles all the migration logic.

endpoints.xml

This is the file where you find the inbound side of your integration app. This template has only a HTTP Listener as the way to trigger the use case.

HTTP Listener Connector - Start Report Generation

  • ${http.port} is set as a property to be defined either on a property file or in CloudHub environment variables.
  • The path configured by default is migratesalesitems and you are free to change for the one you prefer.
  • The host name for all endpoints in your CloudHub configuration should be defined as 0.0.0.0. CloudHub routes requests from your application domain URL to the endpoint.
  • The endpoint is configured as a request-response by placing it in the source section of the flow. The response is the total of sales items synced and filtered by the criteria specified.

errorHandling.xml

This file handles how your integration reacts depending on the different exceptions. This file provides error handling that is referenced by the main flow in the business logic.


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onNov 14, 2018
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.0

Categories

Pattern
MigrationNo values left to add
Object
ProductNo values left to add
Functions
SalesNo values left to add
Products
WorkdaySalesforceNo values left to add