SAP to Workday Organization Migration

(0 reviews)

home

Moves a large set of organizations from SAP to Workday. You can trigger this manually or programmatically with an HTTP call. Organizations are upserted so that the migration can be run multiple times without worrying about creating duplicates. This template uses batch to efficiently process many records at a time.

d4742a57-80f3-493a-ad79-189e50faeb7d-image.png

Workday Requirement

Install Workday HCM, the Human Resources module via the Workday connector.

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 SAP admin I want to migrate organizations to a Workday instance.

This template serves as a foundation for the process of migrating organizations from SAP instance to Workday one, being able to match organizations by Integration ID.

This template leverages the Mule batch module. The batch job is divided into the Process and On Complete stages.

  • During the input stage the template goes to the SAP system and queries all the existing organizations that match the filtering criteria.
  • The last step of the Process stage inserts or updates organizations in Workday, added under a specified organization in the Workday organization hierarchy.
  • Finally during the On Complete stage, the template outputs statistic data in the console and sends an email notification with the results of the batch execution.

Considerations

To make this template run, there are certain preconditions that must be considered that deal with the preparations in both, that must be made for the template to run smoothly. Failing to do so could lead to unexpected behavior of the template. Before continuing with the use of this template, see the SAP connector guide, that teaches you how to work with SAP and Anypoint Studio.

Disclaimer

This template uses a few private Maven dependencies from MuleSoft to work. If you intend to run this template with Maven support, you need to add extra dependencies for SAP to the pom.xml file.

SAP Considerations

Here's what you need to know to get this template to work with SAP.

As a Data Source

The SAP backend system is used as a source of data. The SAP connector is used to send and receive the data from the SAP backend. The connector can either use RFC calls of BAPI functions and/or IDoc messages for data exchange, and needs to be properly customized per the "Properties to Configure" section.

Workday Considerations

As a Data Destination

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

Run it!

Simple steps to get this template running.

This is an example of the output you see after browsing to the HTTP endpoint:

{
  "Message": "Batch Process initiated",
  "ID": "e9354ac0-a9ec-11e8-ae2c-2ac63fa6f77a",
  "RecordCount": 3,
  "StartExecutionOn": "2018-08-27T13:32:42Z"
}

Running On Premises

Fill in all the properties in one of the property files, for example in mule.prod.properties and run your app with the corresponding environment variable to use it. To follow the example, use mule.env=prod.

After this, to trigger the use case you just need to browse to the local HTTP endpoint with the port you configured in your file. If the port is, for instance, 9090 then browse to: http://localhost:9090/migrateorganizations. Browsing to this endpoint causes the template to create a CSV report and send it to the email address you set.

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 as 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. See 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.

Once your app is all set and started, if you choose as the domain name sapwdayorgmig to trigger the use case, you just need to browse to http://sapwdayorgmig.cloudhub.io/migrateorganizations and the output report is sent to the email address you configure.

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

  • http.port 9090
  • page.size 100

SAP Connector Configuration

  • sap.jco.ashost your.sap.address.com
  • sap.jco.user SAP_USER
  • sap.jco.passwd SAP_PASS
  • sap.jco.sysnr 14
  • sap.jco.client 800
  • sap.jco.lang EN

Date in 'YYYYMMDD' format, for example 20190101

  • sap.startDate 20180101
  • sap.endDate 20190101

Note: properties sap.startDate and sap.endDate define a date range that is used for filtering SAP organizations. All organizations with a validity period overlapping with this date range are migrated.

WorkDay Connector Configuration

  • wday.username user1@mulesoft_pt1
  • wday.password ExamplePassword565
  • wday.tenant tenant_example
  • wday.host example.host.com
  • wday.org.subtype Company
  • wday.org.visibility Everyone
  • wday.ext.systemID SAP sync

SMTP Services Configuration

  • smtp.host smtp.gmail.com
  • smtp.port 465
  • smtp.user user@gmail.com
  • smtp.password gmailpassword

Email Details

  • mail.from organizations.report%40mulesoft.com
  • mail.to user@mulesoft.com
  • mail.subject Organization Migration Report

API Calls

There are no particular considerations for this template regarding API calls.

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

Functional aspects of this template are implemented in this XML file, directed by a flow responsible for executing the logic. For the purpose of this template the mainFlow just excecutes a batch job, which handles all its logic.

endpoints.xml

This is the file where you find the inbound and outbound sides of your integration app.

This template has only an 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 migrateorganizations and you are free to change this to one you prefer.
  • The host name for all endpoints in your CloudHub configuration should be defined as localhost. CloudHub then routes requests from your application domain URL to the endpoint.
  • The endpoint is a request-response as a result of calling it causes the response to be the total of organizations 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 20, 2019
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.1
2.1.0

Categories

Pattern
MigrationNo values left to add
Products
SAPWorkdayNo values left to add

Tags