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.  Breaking loop in WTX

    Posted 04/13/10 02:33 PM

    Originally posted by: SystemAdmin


    Hi,

    Can anyone let me know which function can be used to break the loop?

    -Thanks and Regards,Rajesekhar Potteti
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Breaking loop in WTX

    Posted 04/13/10 03:29 PM

    Originally posted by: JGibby


    As far as I know there is no function to break out of a loop other than FAIL(). Unfortunately, this will have a devastating side effect to the completion of the rest of your map.

    I would approach it from a conditional logic point-of-view. That is, I would conditionally do the work in a series object (loop). However, if the conditional logic was overly complex or the criteria was only met in the functional map being executed in the series object, I would utilize the GETANDSET() function against an object. That way I could test it to know whether to call the functional map on subsequent iterations of the series object.
    Series Object:
    
    =IF(BREAKVAR=0,F_FunctionalMap(SeriesObject:DataItem1,DataItem2,BREAKVAR))
    


    F_FunctionalMap:
    
    =SeriesObject:DataItem1 + 
    ":" + Name:DataItem2 +LEFT(IF(SeriesObject:DataItem1 = 
    "XXXXX",GETANDSET(BREAKVAR,1,2)),0)
    


    With this method, the SeriesObject in which you set BREAKVAR will still return a value. That may or may not work out for your situation. I use the LEFT(object,0) function to not return any of BREAKVAR's value in my result.

    I do believe this code would work even though I have not specifically tried it.

    Good Luck,
    John Gibby
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Breaking loop in WTX

    Posted 04/21/10 09:58 PM

    Originally posted by: bdebruin


    If you have objects that can be counted you could use the CLONE function to trigger the functional map a certain amount of times.

    Can you tell us any more information about inputs, output, when to break the loop, etc.?
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender