Originally posted by: SystemAdmin
I'm still not exactly clear why you need to convert the original "contract" text to XML. But, assuming that you need to do that using the RUN function, here's what I would do based on what I understand from your earlier posts.
(1) MAIN_MAP (executable map): This is the map you are currently working on. For this example I'm assuming you want it to have two inputs
-
Input 1: XML_Contract_List
-
Input 2: Other_Data
-
Output 1: Your_Reponse_File
(2) TO_XML_CONTRACT_LIST (executable map): This is the map that converts your Text Contract List to your XML Contract List.
-
Input 1: Text_Contract_List
-
Output 1: XML_Contract_List
(3) STUB_MAP (executable map):
This is a new map that you will execute from the launcher, command line or script instead of "MAIN_MAP". This map will RUN "MAIN_MAP" and "TO_XML_CONTRACT_LIST".
Its inputs and outputs are defined as simple text "blobs" of unlimited size.
-
Input 1: Text_Contract_List
-
Input 2: Other_Data
-
Output 1: Your_Response_File
Here is the rule that you will enter in the Your_Response_File output card of STUB_MAP. It passes the RUN results for TO_XML_CONTRACT_LIST, and Other_Data to a functional map that will RUN "MAIN_MAP".
=f_Run_Main_Map(
RUN("TO_XML_CONTRACT_LIST", ECHOIN(1, Text_Contract_List) + " -OE1"),
Other_Data
)
(4) f_Run_Main_Map (functional map): Here are the inputs/outputs for the functional map and the command that runs MAIN_MAP. Note that I've renamed Input 1 to reflect that it is now an XML text blob.
-
Input 1: XML_Contract_List
-
Input 2: Other_Data
-
Output 1: Your_Response_File
= RUN("MAIN_MAP", ECHOIN(1, XML_Contract_List) + ECHOIN(2, Other_Data) + " -OE1")
I generally use some variation of STUB_MAP for production maps. This allows me to pre-process the input data when there are customer specific variations or other data that needs to be converted as you have in your example, It also gives me a place to process errors returned by the MAIN_MAP.
Final comment: I realize that these are an extra few steps that in an
ideal software tool shouldn't be necessary, but they only take about five minutes to create a stub map. If I have the option, I would prefer to adjust the type tree definitions to simplify the mapping rules but that is not always possible. I don't know of any
ideal software tools. They all have their quirks that you learn to deal with so that you can complete one project and move on to the next one.
#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender#DataExchange