Using Route Resources

Talend ESB Studio User Guide

EnrichVersion
6.5
EnrichProdName
Talend ESB
task
Design and Development
EnrichPlatform
Talend Studio

The Route designer allows you to created external Resources that can be used in Routes, for example, an XQuery file for camel-saxon, a WSDL file for camel-cxf, and so on. This section will show you how to create a Route Resource and how to use it in a Route.

How to create a Route Resource

To create a new Route resource:

  1. In the Repository of the Integration perspective, right-click the Resources node and select Create Resource from the contextual menu.

    The [New Route Resource] wizard opens to help you define the main properties of the new Route Resource.

  2. Enter the Resource properties as the following:

    Field

    Description

    Source File

    the path to a local or remote file to create the Resource from an existing file.

    Name

    the name of the new Resource. A message comes up if you enter prohibited characters.

    Purpose

    the purpose of the Resource or any useful information regarding the Resource use.

    Description

    Resource description.

    Author

    a read-only field that shows by default the current user login.

    Locker

    a read-only field that shows by default the login of the user who owns the lock on the current Resource. This field is empty when you are creating a Resource and has data only when you are editing the properties of an existing Resource.

    Version

    a read-only field. You can manually increment the version using the M and m buttons. For more information, see Managing Job and Route versions.

    Status

    a list to select from the status of the Resource you are creating.

    Path

    a list to select from the folder in which the Resource will be created.

  3. Click Finish to create the Resource.

    If you create the Resource from scratch, an empty Resource opens in the editor on the design workspace.

    If you create the Resource from an existing file, the content of the source file is displayed in the editor on the design workspace.

  4. Edit the code of your Resource and save it.

How to manage Route Resource versions

When you create a Route Resource in the Integration perspective of Talend Studio, by default its version is 0.1 where 0 stands for the major version and 1 for the minor version.

You can create many versions of the same Route Resource. To do that:

  1. Close your Route Resource if it is open on the design workspace, otherwise, its properties will be read-only and thus you can not modify them.

  2. In the Repository tree view, right-click your Route Resource and select Edit properties in the drop-down list.

    The [Edit properties] dialog box is opened.

  3. Next to the Version field, click the M button to increment the major version and the m button to increment the minor version.

  4. Click Finish to validate the modification.

Note

By default, when you open a Route Resource, you open its last version.

To change the version of your Route Resource, you can also:

  1. Close your Route Resource if it is open on the design workspace, otherwise, its properties will be read-only and thus you can not modify them.

  2. In the Repository tree view, right-click your Route Resource and select Open another version in the context menu.

  3. In the dialog box, select the Create check box and click the M button to increment the major version and the m button to increment the minor version.

  4. Click Finish to validate the modification and open this new version of your Route Resource.

You can also save a Route Resource and increment its version in the same time, by clicking File > Save as....

Note

This option does not overwrite your current Route Resource. It saves your Route Resource as another new Route Resource with another version.

You can access a list of different versions of the Route Resource. To do that:

  1. Right-click it in the Repository tree view and select Open another version in the context menu.

  2. Select the version of the Route Resource you want to edit and click Finish to open it in the design workspace.

How to use a Route Resource

Once created, you can use the Route Resources in the Mediation components cSOAP and cMessagingEndpoint, and in Spring configuration. For real-life use cases, see the scenarios provided for cSOAP, cMessagingEndpoint, and cSEDA in Talend Help Center.

To manage the Route Resources in a Route, double-click the Route to open it in the design workspace and click the Dependencies tab to show the Manifest editor.

  • To add a Resource, in the Resources area, click Add... and select the Resource you want from tree view in the dialog. Click OK.

    Once added, you can choose from the different versions of the Resource by clicking the Version field in the Resources table and select the one you want to use from the drop-down list.

  • To remove a Route Resource from the Route, simply select it from the list and click Remove. You can not remove a built-in Route Resource.

  • To copy the path of a Route Resource, select it in the table and click Copy Path so that you can use it in the Route.

Click OK to validate your modifications.

Note

Route Resources used in Routes cannot be deleted it from the repository.

When exporting a Route, the Route Resources that are called in the Route are exported together with the Route into the ESB Runtime KAR file. For more information about how to export Routes, see How to build Routes.