Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

The Template library

The Template library is a discovery interface where you can find templates that can make the adoption of Anypoint Studio a lot easier for you. Although this library can be accessed via your installed copy of Anypoint Studio, it’s read off an online repository that is periodically expanded and updated.

Templates are simple projects that cover typical enterprise integration use cases. If you find one that performs exactly what you need, all you must do is provide it a series of user credentials and it should be good to deploy! You might otherwise find one that comes close to what you need and hence customize or extend it accordingly. All the templates in the library are built based on one of the five data integration patterns:

Migration

Broadcast

Bi-Directional Sync

Aggregation

Correlation

sync

salesforce-integration-templates-broadcast

bisync

salesforce-integration-templates-aggregate

salesforce-integration-templates-synchronize

How to Access the Template library

There are three ways to access the Template library

  • From the icon in the Anypoint Studio toolbar:

    new+icon

  • Through Anypoint Studio’s dropdown menu, through  File → New → Start From Template

  • Through the Template library website 

How to Navigate the Template Library

The Templates library is searchable through tags and keywords. Each project is tagged with labels that refer to things such as the connectors it employs, the Mule Runtime versions it supports, etc. They are also organized by pattern (ie: migrations, aggregations), so you can scan through only those that perform what you’re interested in doing.

new+menu

  • Click Open in Studio to directly download a project into your Studio workspace and open it in Studio.

  • Click View Details to read a brief overview of the project and access more options.

From the Details page, besides opening the project in studio, you can also download a zipped file to your workspace, copy a URL to the corresponding Template library, or access the project’s GitHub repo.

Implementing a Template

Below are the basic steps for implementing any of the Templates

  1. Find the template that best suits your needs and click Open in Studio

    salesforce+db+new

  2. You will now see this project available in your package explorer, take a look at the files it contains

    package+explorer

    When you first open the project it may be marked as having errors, these should simply refer to the fact that the connectors being used in it need to be configured with your user credentials to work.
  3. Open the mule-project.xml file, located directly in the root level of the project folder, if you wish to deploy your app to any environment other than dev, change the value of the mule.env parameter.

    mule.env

  4. All templates in the library come built in such a way that, in order to make them work, all you need to do is include your credentials in the configuration files. All of the connectors and global elements in the project’s flows reference the fields in these configuration files, so (unless you plan on expanding or customizing how the template works) you never really need to modify or even look at anything other than these files.

    environments 

    Under the src/main/resources folder, find the file that corresponds to the environment that you selected for deploying in the previous step, then open it.

  5. Provide a value for each of the fields that the configuration file expects, this may include user credentials, port numbers, callback URLs, etc.

  6. To test your app, save the project and deploy it to Anypoint Studio’s embedded run time by clicking the dropdown menu next to the play button and selecting the project out of the list.
    play

  7. Now your app is now ready to Deploy

Go Further