Workday to Salesforce Hired Employee Broadcast

(0 reviews)

home

This template serves as a foundation for setting an online sync of Employee Hires from Workday to Salesforce Users. Every time there is a new Employee Hire or a change in an already existing one, the integration will poll for them in the Workday source instance and it will be responsible for creating/updating the User in Salesforce with the specified PermissionSet in real time. The detection criteria, and fields that should be moved are configurable. Additional systems can easily added to be notified of changes. Real time synchronization is achieved via rapid polling of Workday or you can slow down the interval to something near real time. This template uses both our batching and our watermarking capabilities to ensure that only recent changes are captured and so that it efficiently processes large amounts of records if you choose to slow down the polling interval.

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 synchronize new Employee Hire or a change in an already existing one by creating/updating the User in Salesforce with the specified PermissionSet.

As implemented, this template leverages the Mule batch module.
The batch job is divided in Process and On Complete stages.

  1. The integration is triggered by scheduler to Workday instance. New or modified employee hires are passed to the batch as input.
  2. In the batch, the user is fetched from Salesforce by the email and mapped to Salesforce input data structure with the specified PermissionSet.
  3. Afterwards every user is sent to destination instance - to Salesforce where it is asynchronously updated or created.

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.
There are a couple of things you should take into account before running this template:

  1. Users cannot be deleted in Salesforce: For now, the only thing to do regarding users removal is disabling or deactivating them, but this won't make the username available for a new user.
  2. Each user needs to be associated to a Profile: Salesforce's profiles are what define the permissions a user has for manipulating data. Each Salesforce account has its own profiles. In this template there's a processor labeled Prepare for Upsert that maps your Profile Ids from the source account to the target account. Note that for the integration test to run properly, you should change the constant DEFAULT_PROFILE_ID in BusinessLogicTestIT to one that's valid in your source test organization.
  3. Working with sandboxes for the same account: Although each sandbox should be a completely different environment, usernames cannot be repeated in different sandboxes. For example, if you have a user with username bob.dylan in sandbox A, you cannot create another user with username bob.dylan in sandbox B. If you are working with sandboxes for the same Salesforce account, map the source username to a different one in the target sandbox, for this purpose, refer to the processor labeled Prepare for Upsert.
  4. Workday email uniqueness: The email can be repeated for two or more accounts (or missing).

Salesforce Considerations

Here's what you need to know about Salesforce to get this template to work:

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.

Run it!

Simple steps to get this template running.

Running On Premises

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

Where to Download Anypoint Studio and the Mule Runtime

If you are new to Mule, download this software:

Note: Anypoint Studio requires JDK 8.

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

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

For this template to run in Anypoint Studio, you need to install SAP Libraries.

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

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

Deploying 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

  • page.size 200

Scheduler Configuration

  • scheduler.frequency 40000
  • scheduler.start.delay 1000

Watermarking default last query timestamp for example 2018-12-13T03:00:59Z

  • watermark.default.expression 2018-12-13T03:00:59Z

Workday Connector Configuration

  • wday.username bob.dylan@orga
  • wday.tenant org457
  • wday.password DylanPassword123
  • wday.host servise425546.workday.com

Salesforce Connector Configuration

  • sfdc.username user@company.com
  • sfdc.password secret
  • sfdc.securityToken 1234fdkfdkso20kw2sd
  • user.localeSidKey en_US
  • user.languageLocaleKey en_US
  • user.timeZoneSidKey America/New_York
  • user.emailEncodingKey ISO-8859-1
  • sfdc.user.profile.id 10000000002D4JWAA0
  • sfdc.user.permission.id 10000000002D5JWAA0

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. User Broadcast Template calls to the API can be calculated using the formula:

1 + X + X / ${page.size}

X is the number of Users to be synchronized on each run.

Divide by ${page.size} because by default, for each upsert API call, users are gathered in groups of a number defined by the ${page.size} property. Also consider that calls are executed repeatedly every polling cycle.

For instance if 10 records are fetched from origin instance, then 12 API calls are made (1 + 10 + 1).

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

This file holds the functional aspect of the template (points 2. to 3. described in the template overview). Its main component is a Batch job, and it includes steps for executing the broadcast operation from Workday to Salesforce.

endpoints.xml

This file should contain every inbound endpoint of your integration app. It is intended to contain the application API.
In this template, this file contains a scheduler endpoint that queries Workday for updates using a watermark.

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 onJan 24, 2019
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.0

Tags