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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  How do you deal with boolean ?

    Posted 11/08/16 08:06 AM

    Hi,

    In a service Java I can return a Boolean to the Pipeline, and then I debug mode I can observe the “T/F” icon for the bool attribute.

    How are you considering these boolean attribute, do you use it ? What is the best usage/recommendations ?

    I’m asking you this question because in most of the examples I’ve seen (ex : PSUtilties, WmPublic) , they use a string return value: ‘true’ or ‘false’ and not a bool one.

    Regards


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


  • 2.  RE: How do you deal with boolean ?

    Posted 11/17/16 12:53 PM

    If you are working with Flow just use String. If you are working in Java.NET\C++ in webMethods then use the right data types for fields. At least that is what my experience taught me.


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


  • 3.  RE: How do you deal with boolean ?

    Posted 11/17/16 01:48 PM

    Hi,

    Thanks for your reply, but when you do Java and Flow Service you would use the 1 or the 2 ?

    Boolean isExist = true;

    1- IDataUtil.put(idc, “isExist”, String.valueOf(isExist));

    2- IDataUtil.put(idc, “isExist”, isExist);

    Regards


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


  • 4.  RE: How do you deal with boolean ?

    Posted 11/17/16 02:00 PM

    It needs to end up as a string in Flow so your Java service will output the variable as string. Option 1.


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


  • 5.  RE: How do you deal with boolean ?

    Posted 11/17/16 02:17 PM

    Hi,

    I think that it is possible to go for the boolean data type even in flow services.

    Just compare them against “true” or “false”, the neccessary conversions will be made internally.

    Additionally the field of type boolean will have a pick list when defining a value for it, which only allows true or false as values.
    This also improves the readability of the service as it is visible that this is a boolean and not just a string.

    See Working_With_Designer Guide and/or Service_Development_Help for further informations.

    Regards,
    Holger


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


  • 6.  RE: How do you deal with boolean ?

    Posted 11/17/16 02:25 PM

    I believe that will be no different than comparing strings in Flow. Its not like you can branch on a Boolean variable with the control going to default sequence if the variable is false.

    Imagine you have a branch on Boolean variable with two sequences under it where one has a label of false and another as a default. If the Boolean variable is false then the Flow will not go to default but it will go to the sequence with label as “false”. It is still reading it as a string rather than boolean. If Flow recognizes the Boolean data type then the control will go to the default sequence rather than the “false” sequence.

    I hope that was not confusing :wink:


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


  • 7.  RE: How do you deal with boolean ?

    Posted 11/17/16 02:31 PM

    In this case it might be better to label the sequences as false and true.

    A third possibility might be the label $null, if the variable has not been initialized.
    But this is a rare occasion as this can only happen when the boolean field is an input field of the service which was not set by the caller.

    Regards,
    Holger


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