IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Using Copy Condition in transformers

  • 1.  Using Copy Condition in transformers

    Posted Tue February 16, 2016 03:43 PM

    Hi all,

    I have a scenario where input field ‘A’ has to be mapped to output field 'B’only if there is some value in A, otherwise if it is coming as a null value, it should not get mapped. I have a transformation to be made for the input field. so i took a transformer in the map step and mapped ‘A’ to transformer input and transformer output to output field ‘B’ for which allow null property is false. I put a copy condition like %A%==/[^ ]/ for the input mapping link, it is working fine as long as there is some value coming in ‘A’,

    If there is nothing coming in A, then B is getting populated as null and it is failing since B doesn’t accept null value.

    Could someone tell me how to fix this. Am I supposed to use Branch condition instead of copy condition. Please shed some light

    Thanks


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: Using Copy Condition in transformers

    Posted Tue February 16, 2016 04:01 PM

    I have to try your scenario. Try using a branch step with evaluate label as “true” use expression as %A%!=$null && %A%!=‘’


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Using Copy Condition in transformers

    Posted Tue February 16, 2016 11:57 PM

    Thanks for your response. Wouldn’t it work only with copy condition without using branch.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 4.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 02:33 AM

    Hello – You just keep the same expression as part of Copy condition, it will work. You no need go for switch.

    Thanks,


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 04:22 AM

    No, it’s not working. The value is coming as null if nothing is passed in A. Please find the attached image for better understanding.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 04:25 AM

    Try this, %A%!=$null && %A%!=‘’

    Thanks,


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 7.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 04:29 AM


  • 8.  RE: Using Copy Condition in transformers



  • 9.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 04:56 AM

    This will work if it is a direct mapping. I am using a transformer in between and facing the issue.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 10.  RE: Using Copy Condition in transformers

    Posted Wed February 17, 2016 07:27 AM

    Hi,

    you will have to put the copy condition on the output mapping as well.

    If this does not work, you will have to go for the branch option.

    Info:
    Transformers are executed when the output is mapped (not sure if this applies when using a copy condition in this).

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 11.  RE: Using Copy Condition in transformers

    Posted Tue October 04, 2016 07:50 PM

    Are you still looking for the solution for this issue.Here are my findings.

    Expression : %A%!=$null && %A%!=‘’

    1. Make sure you select the transformer and change the validateInput property as true.
    2. Your logic should be in Try - Catch block.

    I tried it and is working to me.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services