Hello Integration Hub

This tutorial:

  • Illustrates the role Integration Hub plays in enterprise integration.

  • Introduces Transaction Designer, an Integration Hub feature that enables you to design the elements of a transaction from beginning to end.

  • Provides instructions for using Transaction Designer to configure Integration Hub so that you can simulate a transaction and see how Integration Hub processes it.

Use case

FastBoards is a manufacturer of high quality, low cost skateboards. Because of their premium quality and growing customer base, they are growing very quickly in terms of volume and acquisitions. That means they need to be very agile with integration between multiple systems and rapid implementation. FastBoards uses SAP as their ERP system and is currently integrated with legacy mainframe systems. But the new IT leadership realizes and feels the need to modernize the infrastructure and decided to add Salesforce as their CRM and Magento as their ECOM platform. With the growing number acquisitions, the number of systems required to connect with SAP also keeps growing. FastBoards also needs to connect to their Business partners, where GearCo is their retailer and RoundWheels is their supplier/vendor.

img-use-cases
Figure 1. Use Cases

In this tutorial, we work with the following scenarios:

When a shipment is ready, SAP populates a Shipment IDOC ( ZDELVRY03_620) message. This needs to be broadcasted to all the connected systems (LEGACY mainframe, Salesforce and E-commerce platforms). Since FastWheels management realizes the importance of API-led architecture, the System APIs for each of the underlying systems are already present.

SAP to Legacy

  • When a ZDELIVERY_620 message is received, it needs to be transformed to Legacy system API format in JSON.

  • The message is then sent to the System API endpoint.

  • Does not require any filter operation

SAP to Salesforce

  • When a ZDELIVERY_620 message is received, it needs to be transformed to SalesForce system API format in JSON

  • The message is then sent to the System API endpoint.

  • Does not require any filter operation

SAP to E-Commerce

  • When a ZDELIVERY_620 message is received, it needs to be transformed to E-commerce system API format in JSON.

  • The message is then sent to the System API endpoint.

  • Does not require any filter operation

SAP to GearCo (B2B Partner)

  • When a ZDELIVERY_620 message is received, it is sent out as an X12 856 message to GearCo, as follows:

    • Transform and Render to EDI X12 856 ( ASN ) for GearCo.

    • Route the message to the designated partner endpoint.

  • The message:

    • Will only be sent to B2B process

    • Content indicates EDI message

    • Indicates the partner is GearCo

This process consists of these steps:

  • Integration Hub initial setup

  • Routing engine setup

  • SAP to Salesforce integration

In this example, we configure the SAP to Salesforce integration. The other applications can be similarly integrated.

Before you Begin

Verify that you have the following:

  • Anypoint Platform user account with Integration Hub access

  • URL: https://tpm-service-release-8.dev.portx.io/portal

    • User Name: demo@modusbox.com

    • Password: SMiarbY2!
      If you are unable to access Integration Hub, see your PortX account administrator for assistance, or to set up a trial account.

  • Anypoint Studio with Mule 3.9.1

  • Download IHub Tutorial Materials

Integration Hub Initial Setup

  1. Create an S3 bucket for Integration Hub persistence

  2. Specify authentication for S3 persistence

  3. Retrieve API key (Please make sure to create API only for your environment. Please read and follow the warnings given)

  4. Follow instructions to retrieve the environment and retrieve the environment id for your environment

Routing engine setup

  1. Download the latest from Git Hub

  2. Update the (which?) Settings file XML with latest modus jfrog creds

  3. Update the property file with the following

  4. Update the Properties with files with PortX api, tracker and environment Id and api key

  5. Retrieve the Environment id and API key for the PortX environment to which you are trying to connect

  6. Get the S3 configuration and update

  7. Update the Partner name , Make sure application property/ muleproject.xml is updated with the correct environment and tenant information

Get Started

Configure SAP Application

  1. Open PortX Integration Hub. On the left-hand menu, click Partners and Applications.

  2. Click Add Application.

img-create-app
Figure 2. Create App
  1. Enter Application Name (SAP)  and contact information

  2. Click save

  3. On the left-hand menu click on View Relationships.

  4. Select SAP ↔ *Any

img-relationships
Figure 3. Relationships

This will allow you to define all the artifacts/resources that pertain to domain SAP.

  1. Click Transaction Design  on the right-hand side menu and click Create template.

img-td
Figure 4. Transaction Designer

This will open up New Transaction view.

img-new-transaction
Figure 5. New Transaction
  1. On the Source Channel click Create New Channel.

img-create-source-channel
Figure 6. Create Source Channel
  1. Click New Document.
    This should open Create Document window; no need to enter a name, it will be auto-generated.

img-create-document
Figure 7. Create Document
  1. Select XML as the standard

  2. Leave namespace empty

  3. Enter root node of the XML document as message type in our case enter ZDELVRY03_620

  4. Go to the property tab and click Add Property

img-add-property
Figure 8. Add Property
  1. Select EDIProcess-Demo if property not added you can add new property

  2. In the Property Source Type  select Document

  3. In Path enter Xpath of the field you want to promote, in this case /ZDELVRY03_620/IDOC/EDI_DC40/TABNAM , Click on Save Property

  4. Save the document which will take you back to the transaction template creation page

img-source-document-properties-view
Figure 9. Source Document (Properties View)
  1. Click on Save Template
    The template can be used to define all the integration that involves message type ZDELVRY03_620 from SAP
    Now it is time to add a Receive endpoint to receive the shipment from SAP

  2. In relationship SAP ↔*Any, click on Endpoints

img-endpoints
Figure 10. Endpoints
  1. Click New.

img-new-endpoint
Figure 11. New Endpoint
  1. Select protocol as HTTP
    Type: Receive
    Protocol Affinity: None

  2. Uncheck Uses Persistence Settings and Default for SAP : Any

  3. Let the Global Configuration Settings unchanged

img-endpoint-operation-settings
Figure 12. Endpoint Operation Settings
  1. In the Operation Settings section:
    Host : 0.0.0.0
    Port: 8089
    Path: /pxhub/sap/api/v1/shipment
    Allowed methods: POST

  2. In the Properties tab, click New Property

img-new-property
Figure 13. New Property
  1. On the page:
    Property Type: From Partner Identifier
    Property Source Type: Constant
    Path: SAP

  2. Click Save button on the endpoint

Create and Configure SalesForce Application

  1. Click on View Relationships, select Salesforce ↔ *Any

  2. On the lefthand menu click on the Document Types

img-document-types
Figure 14. Document Types
  1. Click New

  2. Select JSON as standard

  3. Enter SalesforceShipment as message type

  4. Click Save.

  5. On the left-hand menu, click Endpoints.

  6. Click New/

  7. Select the protocol as HTTP
    Type: HTTP

  8. Uncheck Uses Persistence Settings and Default for SAP : Any

  9. Let the Global Configuration Settings unchanged

  10. In the Operation Settings section:
    Host : routing-engine-demo-api.us-w2.cloudhub.io
    Port: 80
    Path: demoapps/system/api/shipments
    Method: POST

  11. In the Authentication section:
    Set Type : None

Configure Shipment Transaction from SAP to SalesForce

Now that we have the reusable component configured, it is time to set up a Shipment transaction from SAP to SalesForce

  1. On the Left-hand Menu, navigate to Relationships

  2. Select Applications Tab

  3. Click Add Relationship

img-add-relationship
Figure 15. Add Relationship
  1. Set the applications to SAP and SalesForce

  2. Click Submit

  3. On the relationship SAP ↔ Salesforce:

    1. Navigate to Transaction designer and click on Start From Template

    2. Select the template created

img-pick-a-template
Figure 16. Pick a Template

This gets the source channel pre-populated

img-pre-populated-source-channel
Figure 17. Pre-populated Source Channel
  1. On the target channel, click Create New Channel

img-new-target-channel
Figure 18. New Target Channel)
  1. On the source document, click Existing Document

  2. Select XML-ZDELVRY03_620:(SAP:Any) generated earlier ( Add link )

  3. On the Target Document click on select Existing Document

  4. Select JSON-SalesforceShipment:(Salesforce:Any)

  5. On the map click on New Map. + The Source Document and Target Document will be prepopulated

  6. In the Mapping Type select Dataweave

  7. Click on the Script and upload JSON Target Dataweave.dwl  from the artifacts folder

  8. Click Save

  9. On the Endpoint, click Existing

img-ick-an-endpoint
Figure 19. Pick an Endpoint
  1. Select one created earlier in Salesforce:ANY name spaceHTTP-SEND:(Salesforce:Any)

  2. Click Save

img-completed-target-channel
Figure 20. Completed Target Channel