GithubHelp home page GithubHelp logo

lenka-mizikova / template-sap2sfdc-contact-migration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mulesoft-assets/template-sap2sfdc-contact-migration

0.0 0.0 0.0 193 KB

Anypoint Template: SAP to Salesforce Contact Migration

License: Other

Java 100.00%

template-sap2sfdc-contact-migration's Introduction

Anypoint Template: SAP2SFDC-contact-migration

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

Use this template if would like to sync Customer's Contacts from SAP to Salesforce Contacts in manner one time synchronization hitting the Http endpoint Inboud SAP endpoint retrieves all Contacts in SAP using standard BAPI BAPI_CUSTOMER_GETCONTACTLIST and transforms them to Salesforce Contacts In this template you may to choose whether Account for Contact should be created as well during the process. This functionality relies on standard BAPI for retrieving details about customers BAPI_CUSTOMER_GETDETAIL2

Considerations

To make this Anypoint Template run, there are certain preconditions that must be considered. All of them deal with the preparations in both source (SAP) and destination (SFDC) systems, that must be made in order for all to run smoothly. Failling to do so could lead to unexpected behavior of the template.

Before continue with the use of this Anypoint Template, you may want to check out this Documentation Page, that will teach you how to work with SAP and Anypoint Studio-

Disclaimer

This Anypoint template uses a few private Maven dependencies in oder to work. If you intend to run this template with Maven support, please continue reading.

You will find that there are three dependencies in the pom.xml file that begin with the following group id: com.sap.conn.jco These dependencies are private for Mulesoft and will cause you application not to build from a Maven command line. You need to replace them with "provided" scope and copy the libraries into the build path.

SAP Considerations

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

As source of data

SAP backend system is used as source of data. 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 as per chapter: Properties to be configured

  1. Partner profile Partner profile needs to be customized type of logical system as partner type. Outbound parameter of message type MATMAS is defined in the partner profile. As receiver port an RFC destination created earlier is used. Idoc Type MATMAS01 is defined.

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

  • Enabling Your Studio Project for SAP
  • Run it!

    Simple steps to get SAP2SFDC-contact-migration 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.

    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

    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

    SalesForce Connector configuration

    • sfdc.username bob.dylan@sfdc
    • sfdc.password DylanPassword123
    • sfdc.securityToken avsfwCUl7apQs56Xq2AKi3X
    • sfdc.url https://test.salesforce.com/services/Soap/u/28.0

    SMPT Services configuration

    • smtp.host smtp.gmail.com
    • smtp.port 587
    • smtp.user gmailuser
    • smtp.password gmailpassword

    Mail details

    Policy for creating accounts in SF syncAccount, assignDummyAccount, doNotCreateAccount

    • account.sync.policy syncAccount

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

    X * 3 + X / 200

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

    Multiplication by 3 is because for every user if account.sync.policy is set to value syncAccounts for every contact will be checked if an account with matching name exists in Salesforce and if not it will be created.

    The division by 200 is because, by default, contacts are gathered in groups of 200 for each Upsert API Call in the commit step.

    For instance if 10 records are fetched from origin instance, then 1 api calls to SFDC will be made ( 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

    A functional aspect of this Anypoint Template implemented in this XML is to create or update objects in the destination system for a represented use case. You can customize and extend the logic of this Anypoint Template in this XML to more specifically meet your needs.

    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.

    template-sap2sfdc-contact-migration's People

    Contributors

    damiansima avatar icfl avatar marecica2 avatar marekpataky avatar pmantellini avatar rusinm avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.