Translator CallBack

Overview

Using a Java Class for Translator Callback allows you to allows you to select a translation map based on the contents of the input data by modifying the Java code.

Note: This function is not available for XML input.

Enable Callback

To enable Translator CallBack:

  1. Select the TIBCO ActiveMatrix BusinessWorks™ Application Module when creating a new project.

  2. Enter a project name, select the Use Java configuration checkbox, and click Next.

  3. Select the CallBack checkbox in the Translator activity General tab and click the Create a new class icon .

  4. Enter a class name and click Finish.

    A Java class is created with default functions and variables.

Result

MSH information will be set to HashMap<String, String> infoMap

Use the “get” function to access the values in the map.

infoMap.get("Info.MessageTypeMessageCode")

Setting the Map, Source Guideline and Target Guideline

Refer to the associated examples:

If Map Resides on Disk (Translator Database Directory)

Set up the Map file name.
  1. Directly assign the map name to variable mapFileName.
    mapFileName = “VXR_V03_VXR_V03_EX.map”;
  2. Update the configName variable with the format configName=mapname||.
    configName=“VXR_V03_VXR_V03_EX.map||”

If Map Resides in Memory (Database)

  1. Update the configName variable with the format configName = MapName|SourceGuidelineName|TargetGuidelineName;
  2. Assign the map image to variable mapFileBuffer =(map image in byte[]).
  3. Specify the source guideline variable with the format sourceGuidelineBuffer = (source guideline image in byte[]);
  4. Specify the target guideline variable with the format targetGuidelineBuffer = (target guideline image in byte[]);