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.


#TechXchangePresenter
 View Only
  • 1.  Set valuein service with %% when variable is null

    Posted Wed January 30, 2019 06:22 PM

    Hi,
    I have a flow service fs1 with need a variable a in input.
    When I invoke the flow service fs1 into another flow service and I put the value of my variable a to %b% (and validate the checkbox Perform pipeline variable substitution), my value to a is b.
    But when b is null, I expect to have nothing in a or null. I have %a% instead of. I’m wondering how I can change that


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


  • 2.  RE: Set valuein service with %% when variable is null

    Posted Fri February 01, 2019 07:43 AM

    You could use a condition on the mapping line, i.e. let it execute only if b is not null. But I generally don’t like conditions on mappings because they are overseen very easily. Hence I’d probably first assign a default value to b, ant then assign b to a.


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


  • 3.  RE: Set valuein service with %% when variable is null

    Posted Fri February 01, 2019 08:23 AM

    Hello fml2,
    Thanks for ur reply.
    In fact I prefer have null value because for me, null is an information. (Espacially when I save in database).
    I want to use a set value because in the an array I have in input and I didn’t want to make a loop to assign value


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


  • 4.  RE: Set valuein service with %% when variable is null

    Posted Fri February 01, 2019 04:34 PM

    Using my approach, you’ll get a perfect NULL value in the database. IIUC, your problem was that you get the string “%a%” (three chars) if a has no value. My proposal should prevent that.


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


  • 5.  RE: Set valuein service with %% when variable is null

    Posted Sat February 02, 2019 12:30 PM

    I know that works.
    The things is I begin to have little experience of webMethods products but I learn about it every day.
    So I Wonder if it exists some tricks to haven’t three characters when I set value %a% when a is NULL.
    Something like bracket or slash or regular expression. I’m not blocked, just curious


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


  • 6.  RE: Set valuein service with %% when variable is null

    Posted Mon February 04, 2019 06:19 AM

    Hi Vital,

    Of course, you could branch on your variable and MAP it only if it not null.
    A BRANCH on /./ will do the trick.

    However, the response of fml2 * is certainly the way to go.


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


  • 7.  RE: Set valuein service with %% when variable is null

    Posted Mon February 04, 2019 03:05 PM

    Strictly speaking, “/./” does not check for “not null”, but for a non empty string. To check for not null, you’d have to write “/.*/”. But since some DBs store empty strings as NULL, there might be no difference in the end.


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