IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Functional Map Arguments

    Posted 01/01/10 01:47 PM

    Originally posted by: Liv2luv


    I am transforming a text file into an xml file. The text file follows copy book format and has "DEPENDING ON - OCCURS" clause, therefore the xml output needs to iterate depending on the item value in the copy book. In the xml output file I have defined a functional map with input record as argument.

    Eg: =F_FUNCTIONALMAP(ENROLLMENT_LIST Group:RESPONSE_DETAIL:txtInput)

    This is good only for 1 iteration. But for multiple iterations, this does not work because the iteration should be dependent upon the count value in the text file. Therefore when I am passing two arguments to the functional map as ;

    = F_FUNCTIONALMAP(ENROLLMENT_LIST Group:RESPONSE_DETAIL:txtInput , COUNT(ENROLLMENT_LIST_COUNT Field:RESPONSE_DETAIL:txtInput))

    the build throws following error :

    Map: NewMap1 Output: enrlDetail:sequence:enrlDetails:sequence:contractDetails:sequence:xmlOutput
    Number of arguments for functional map F_FUNCTIONALMAP is incorrect.
    Number specified: 2 Number required: 1

    The documentation says, we can have more than one argument for the functional map and the map would be triggered only when the argument value evaluates to some valid number.

    Can some one help me how to pass correct valid arguments to the functional map and the map should be evaluated depending on the COUNT of the item.

    Thanks,

    WTX 8.2.0.4
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Functional Map Arguments

    Posted 01/04/10 02:31 AM

    Originally posted by: Kepa_Screen


    Yes you can ! ;)

    You must delete your F_FUNCTIONALMAP first, and recreate it with functional map wizard.
    You are modifiying the rule where that functional map it's used with a new parameter, but you forgot to recreate functional map first in order to add that second parameter.

    Hope this helps.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 3.  Re: Functional Map Arguments

    Posted 01/04/10 09:21 AM

    Originally posted by: NancyR


    Deleting the functional map and recreating it is one solution.

    The problem is your rule is calling a functional map and passing two parameters so WTX expects to the functional map to have two input cards. If you have a lot of rules in your functional map you may not want to delete it and start over again.

    You can manually add a second input card to the functional map to represent the second paramater. If it's not so easy to figure out which type to use in that input card, you can append a character to the name of your functional map in the rule, for example:
    F_FUNCTIONALMAP1(ENROLLMENT_LIST Group:RESPONSE_DETAIL:txtInput , COUNT(ENROLLMENT_LIST_COUNT Field:RESPONSE_DETAIL:txtInput))
    Use the functional map wizard to create this map, copy input card #1 to your original functional map and then edit the extra character out of the name of the functional map in your rule. You'll also want to delete the F_FUNCTIONALMAP1 so you don't get a build error for having output types with no rule.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 4.  Re: Functional Map Arguments

    Posted 01/06/10 10:30 AM

    Originally posted by: LaurentB


    To elaborate on Nancy's answer, I'd only add that, instead of passing COUNT (your object), you may want to use the CLONE function, to trigger as many calls to the functional map as needed.

    e.g. = F_FUNCTIONALMAP(CLONE(ENROLLMENT_LIST Group:RESPONSE_DETAIL:txtInput , ENROLLMENT_LIST_COUNT Field:RESPONSE_DETAIL:txtInput))

    This way, the functional map is called as many times as specified in ENROLLMENT_LIST_COUNT, and receives ENROLLMENT_LIST as an argument.
    Note that in this case the map only has one argument.

    Hope this makes sense
    Laurent
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Functional Map Arguments

    Posted 01/06/10 04:38 PM