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.
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
- In the IBM® App Connect Enterprise Toolkit, create a message flow in an application and add a Mapping node.
- Double-click the Mapping node. The New Message Map wizard opens.
- In the Container field, click New.
- Specify a name for the library, then click Next.
- Select the shared library that contains the Java code that is required by the map, then click Finish.
- 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.
- Select the mapping input and output models, then click Next.
- The output domain is set automatically according to the selected output model. Click Finish.
- 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.