Collects and merges organizations from Workday and SAP into a CSV file. You can modify this basic pattern to collect from one or more different sources and produce formats other than CSV. You can trigger this manually, or programmatically with an HTTP call.
Workers are sorted such that the ones only in Workday appear first, followed by those only in SAP, and lastly by the those in both systems. The custom sort or merge logic can be easily modified to present the data as needed. This template also serves as a base for building APIs using the Anypoint Platform.
Aggregation templates can be easily extended to return a multitude of data in mobile friendly form to power your mobile initiatives by providing easily consumable data structures from otherwise complex backend systems.
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.
As a SAP admin I want to aggregate organizations from Workday and from SAP and compare them to see which organizations can only be found in one of the two and which organizations are in both instances.
This template:
- Generates its results in a CSV report sent by email.
- Extracts data from two systems, aggregates data, compares values of fields for the objects, and generates a report on the differences.
- Gets organizations from Workday and from SAP, compares by the name of the organizations, generates a CSV file which shows organizations in Workday and in SAP. The report is then emailed to a configured group of email addresses.
To make this template run, there are certain preconditions that must be considered. All of them deal with the preparations in both, that must be made for the template to run smoothly. Failing to do so can lead to unexpected behavior of the template.
Before continuing to use this template, see the SAP connector guide to work with SAP and Anypoint Studio.
This template uses a few private Maven dependencies from MuleSoft ito work. If you intend to run this template with Maven support, you need to add three extra dependencies for SAP to the pom.xml. See SAP XML and Maven Support.
Here's what you need to know to get this template to work with SAP.
There are no considerations with using SAP as a data destination.
The Workday connector currently does not support autopaging functionality out of the box so number of processed objects are limited to the connector's single page size.
Simple steps to get this template running.
Complete all 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 this is, for instance, 9090
then you should browse to: http://localhost:9090/generatereport
and this will create a CSV report and send it to the mails set.
If you are new to Mule, download this software:
Note: Anypoint Studio requires JDK 8.
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.
After you import your template into Anypoint Studio, follow these steps to run it:
- Locate the properties file
mule.dev.properties
, in src/main/resources. - Complete all the properties required per the examples in the "Properties to Configure" section.
- Right click the template project folder.
- Hover your mouse over
Run as
. - Click
Mule Application (configure)
. - Inside the dialog, select Environment and set the variable
mule.env
to the valuedev
. - Click
Run
.
For this template to run in Anypoint Studio, you need to install SAP Libraries.
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
.
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, supposing you choose as domain name workdayorganizationsaggregation
to trigger the use case you just need to browse to http://workdayorganizationsaggregation.cloudhub.io/generatereport
and the report is sent to the emails configured.
In Studio, right click your project name in Package Explorer and select Anypoint Platform > Deploy on CloudHub.
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.
- http.port
9090
- wday.username
bob.dylan@orga
- wday.tenant
org457
- wday.password
DylanPassword123
- wday.host
servise425546.workday.com
- 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
- smtp.host
smtp.gmail.com
- smtp.port
587
- smtp.user
[email protected]
- smtp.password
ExamplePassword456
- mail.from
[email protected]
- mail.to
[email protected]
- mail.subject
Organization Report
- mail.body
Please find attached your Organization Report
- attachment.name
OrganizationsReport.csv
There are no special considerations regarding API calls.
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
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.
The functional aspect of this template is implemented in this XML file, directed by one flow responsible of conducting the aggregation of data, comparing records and finally formatting the output, in this case being a report. Using Scatter-Gather component we are querying the data in different systems. After that the aggregation is implemented in DataWeave 2 script using Transform component.
Aggregated results are sorted by source of existence:
- Organizations only in Workday
- Organizations only in SAP
- Organizations in both Workday and SAP and transformed to CSV format. Final report in CSV format is sent to email, that you configured in mule.*.properties file.
This file provides the endpoint to start the aggregation. This template has an HTTP Listener as the way to trigger the use case.
HTTP Inbound Endpoint - 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
generatereport
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
localhost
. CloudHub will then route requests from your application domain URL to the endpoint.
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.