Skip to content

lenka-mizikova/template-wday2sfdc-workercase-broadcast

 
 

Repository files navigation

Anypoint Template: Workday Salesforce Worker Case Broadcast

License Agreement

Note that using this template is subject to the conditions of this License Agreement. Please review the terms of the license before downloading and using this template. In short, you are allowed to use the template for free with Mule ESB Enterprise Edition, CloudHub, or as a trial in Anypoint Studio.

Use Case

As a Workday admin I want to broadcast Workers to Salesforce Case instances.

This Anypoint Template should serve as a foundation for the process of broadcasting Worker from Workday instance to Salesforce, being able to specify filtering criteria and desired behavior when a case already exists in the destination system.

As implemented, this Anypoint Template leverages the Batch Module. The batch job is divided in Input, Process and On Complete stages. During the Input stage the Anypoint Template will query Workday for all the existing active workers that match the filter criteria. The criteria is based on manipulations within the given date range. The last step of the Process stage will group the cases and create them in Salesforce. Finally during the On Complete stage the Anypoint Template will output statistics data into the console.

Considerations

Salesforce Customization: It is necessary to add a custom field ExtId (Text 255) to Salesforce Case object. For more information, please see Salesforce - Create Custom Fields. Note: This particular Anypoint Template illustrate the synchronization use case between SalesForce and a Workday.

Salesforce Considerations

There may be a few things that you need to know regarding Salesforce, in order for this template to work.

In order to have this template working as expected, you should be aware of your own Salesforce field configuration.

###FAQ

As destination of data

There are no particular considerations for this Anypoint Template regarding Salesforce as data destination.

Workday Considerations

As source of data

There are no particular considerations for this Anypoint Template regarding Workday as data origin.

Run it!

Simple steps to get Workday Salesforce Worker Case Broadcast running.

Running on premise

In this section we detail the way you should run your Anypoint Template on your computer.

Where to Download Mule Studio and Mule ESB

First thing to know if you are a newcomer to Mule is where to get the tools.

  • You can download Mule Studio from this Location
  • You can download Mule ESB from this Location

Importing an Anypoint Template into Studio

Mule Studio offers several ways to import a project into the workspace, for instance:

  • Anypoint Studio generated Deployable Archive (.zip)
  • Anypoint Studio Project from External Location
  • Maven-based Mule Project from pom.xml
  • Mule ESB Configuration XML from External Location

You can find a detailed description on how to do so in this Documentation Page.

Running on Studio

Once you have imported you Anypoint Template into Anypoint Studio you need to follow these steps to run it:

  • Locate the properties file mule.dev.properties, in src/main/resources
  • Complete all the properties required as per the examples in the section Properties to be configured
  • Once that is done, right click on you Anypoint Template project folder
  • Hover you mouse over "Run as"
  • Click on "Mule Application"

Running on Mule ESB stand alone

Complete all properties in one of the property files, for example in [mule.prod.properties] (../master/src/main/resources/mule.prod.properties) and run your app with the corresponding environment variable to use it. To follow the example, this will be mule.env=prod.

Running on CloudHub

While creating your application on CloudHub (Or you can do it later as a next step), you need to go to Deployment > Advanced to set all environment variables detailed in Properties to be configured as well as the mule.env. Once your app is all set and started, there is no need to do anything else. Every time a custom object is created or modified, it will be automatically synchronised to SFDC Org B as long as it has an Email.

Deploying your Anypoint Template on CloudHub

Mule Studio provides you with really easy way to deploy your Template directly to CloudHub, for the specific steps to do so please check this link

Properties to be configured (With examples)

In order to use this Mule Anypoint Template you need to configure properties (Credentials, configurations, etc.) either in properties file or in CloudHub as Environment Variables. Detail list with examples:

Application configuration

Properties to be used across all the environments. They can be overwritten.

  • poll.frequencyMillis 10000
  • poll.startDelayMillis 500
  • poll.offset 3000
  • watermark.default.expression #[groovy: new GregorianCalendar(2016, Calendar.JANUARY, 28, 13, 00, 00)]

Workday Connector configuration

  • wday.user joan
  • wday.tenant acme_pt1
  • wday.password joanPass123
  • wday.hostname your_impl-cc.workday.com

Salesforce Connector

  • sfdc.username user@company.com

  • sfdc.password secret

  • sfdc.securityToken 1234fdkfdkso20kw2sd

  • sfdc.url https://login.salesforce.com/services/Soap/u/32.0

  • sfdc.description "Welcome Package"

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

1 + X + X / 200

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

The division by 200 is because, by default, Users are gathered in groups of 200 for each Upsert API Call in the commit step. Also consider that this calls are executed repeatedly every polling cycle.

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

Customize It!

This brief guide intends to give a high level idea of how this Anypoint Template is built and how you can change it according to your needs. As mule applications are based on XML files, this page will be organized by describing all the XML that conform the Anypoint Template. Of course more files will be found such as Test Classes and Mule Application Files, but to keep it simple we will focus on the XMLs.

Here is a list of the main XML files you'll find in this application:

config.xml

Configuration for Connectors and Properties Place Holders are set in this file. Even you can change the configuration here, all parameters that can be modified here are in properties file, and this is the recommended place to do it so. Of course if you want to do core changes to the logic you will probably need to modify this file.

In the visual editor they can be found on the Global Element tab.

businessLogic.xml

Functional aspect of the Anypoint Template is implemented on this XML, directed by one flow that will poll for Workday creations/updates. The severeal message processors constitute four high level actions that fully implement the logic of this Anypoint Template:

  1. At first the Anypoint Template will go to the Workday and query all the existing workers that match the filter criteria.
  2. During the Process stage, each Workday Worker will be filtered depending on, if it has an existing matching case in the SFDC Organization. The logic ensures matching worker with an account and a contact (and creating if it does not exist).
  3. The last step of the Process stage will group the cases and create/update them in SFDC Organization. Finally during the On Complete stage the Anypoint Template will log output statistics data into the console.

endpoints.xml

This is file is conformed by a Flow containing the endpoints for triggering the template and retrieving the objects that meet the defined criteria in the query. And then executing the batch job process with the query results.

errorHandling.xml

This is the right place to handle how your integration will react depending on the different exceptions. This file holds a Choice Exception Strategy that is referenced by the main flow in the business logic.

About

Anypoint Template: Workday Salesforce Worker Case Broadcast

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%