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.  Component rules in type trees

    Posted 11/14/12 03:52 PM

    Originally posted by: sam.plyler


    I am trying to make my type tree such that a particular element will only accept two strings. The field is a currency field, and I would only like for it to accept CAD and USD as values. I am unsure of how the logic for this would work through WTX, but what I had in mind was this.

    If currency = "CAD" || currency = "USD" then set to that value, else none

    I know this is a pretty basic logical statement, but there is hardly any examples on how to use syntax in this program, and I can't figure out how to use the OR operation so that I can test for both CAD and USD from one rule.

    Thank you for all help!


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


  • 2.  Re: Component rules in type trees

    Posted 11/15/12 03:35 AM

    Originally posted by: SystemAdmin


    Hello,

    there's no way to "force" an output card to refuse a value based on the type tree.

    If you set a component rule, then you can use the Data Audit Settings and the Audit log to detect the fact that your map created invalid data.

    Another solution could be to use a "reference" series of the allowed values, and accept to map only of the proposed value is in the allowed set.

    Something like

    =IF (MEMBER (SomeData, Currency:Reference), SomeData, FAIL ("Invalid currency : " + SomeData))

    Thinking more about it, this rule does not seem right. I'd rather check the input values and make the data invalid (via a component rule) if they are not in the allowed values.

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


  • 3.  Re: Component rules in type trees

    Posted 11/15/12 11:07 AM

    Originally posted by: SystemAdmin


    Another approach is to use a restriction list in your type tree, instead of a component rule.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Component rules in type trees

    Posted 11/15/12 04:37 PM

    Originally posted by: sam.plyler


    I looked into both methods, and it seems that a restriction list is my better option. I followed the instructions I found on another post but I am still getting undesired output. Here is what I tried:

    1) In my properties for the Currency element I set the Restrictions to 'Value', Ignore case to 'No', and Rule to 'Include'.

    2) In the Currency code element I added 'CAD' and 'USD' to there own Include row.

    3) Analyze and save type tree.

    4) Rebuild source before execution

    Is there something I might be missing?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: Component rules in type trees

    Posted 11/16/12 02:56 AM

    Originally posted by: SystemAdmin


    This sounds correct. What exactly is happening when you run the map with invalid data? Have you run the map with trace on?
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: Component rules in type trees

    Posted 11/16/12 04:16 PM

    Originally posted by: SystemAdmin


    Not sure we understand each other here. If the restriction list is on the output card's type tree, then nothing can forbid the mapping rules to "force" invalid data through.

    The restriction list and component rules will only work on input (and make data invalid), or help reporting invalid data WAS generated (via data audit)

    Pardon me if this was already what you understood
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Component rules in type trees

    Posted 11/19/12 07:24 AM

    Originally posted by: SystemAdmin


    Sorry for any confusion, I was only trying to answer the question from the original posting:

    "I am trying to make my type tree such that a particular element will only accept two strings. The field is a currency field, and I would only like for it to accept CAD and USD as values."

    This makes no mention of input or output cards, and I was merely suggesting a restriction list (on the INPUT tree) as a simple way to achieve this.

    I guess we interpreted this question differently!
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange