Example: Sharing map files between solutions

When you need to use the same map files in multiple solutions, store those map files in a shared library. You can access the map files in the shared library by using Mapping nodes in your applications.

About this task

In this scenario, a map is used by multiple solutions. Therefore, the map is contained in a shared library so that multiple applications can reference it. This map uses a custom Java™ transformation, which is also used by multiple maps. Therefore, the Java code is also stored in a shared library, so that multiple shared libraries can reference it.

Example 1: The Mapping nodes in two different applications use the map file in a shared library. That map file uses a custom Java transformation, which is stored in the same shared library.
Example 2: The Mapping nodes in two different applications use the map file in a shared library. That map file uses a custom Java transformation, which is stored in another referenced shared library.

To create the scenario shown in example 2, complete the following steps. These steps assume that the Java code already exists in a shared library.

Procedure

  1. In the IBM® Integration Toolkit, create a message flow in an application and add a Mapping node.
  2. Double-click the Mapping node. The New Message Map wizard opens.
  3. In the Container field, click New.
  4. Specify a name for the library, then click Next.
  5. Select the shared library that contains the Java code that is required by the map, then click Finish.
  6. To specify an alternative location for the mapping schema files, clear Use default broker schema and select the location of the mapping schema files. Click Next.
  7. Select the mapping input and output models, then click Next.
  8. The output domain is set automatically according to the selected output model. Click Finish.
  9. Save the message flow.

Results

You can view your resources in the Application Development view. An application contains the message flow. One shared library contains the message map, and another shared library contains the Java code that is required by that message map.

If you view the properties for the Mapping node, you can see that the Mapping routine field is set to the location of the map file. The location is in the following format: {default}:MapFlow_Mapping in Shared Library MapShlib. This value specifies that the map file is called MapFlow_Mapping, it uses the default broker schema, and it is contained in the shared library MapShlib.

What to do next

Deploy your resources. Shared libraries that are referenced by applications must be deployed with or before the applications that refer to them. You can deploy the shared libraries directly to the integration server before you deploy the applications. Alternatively, you can include the applications and shared libraries in a BAR file and deploy the BAR file.

If you update the map file or Java code in the shared libraries, those changes are available automatically to all applications that refer to those shared libraries.