webMethods

webMethods

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
  • 1.  compare boolean in flow service

    Posted Thu March 27, 2014 08:20 AM

    Hello,

    I have created a documentType from an XML Schema in the designer. In this XML Schema, some fields are boolean, and they have been created as a String data type, with content type boolean.
    In a branch, how am I supposed to test the value of this boolean? Do I have to compare it to “1”,“true”,“0” and “false”? Is there any option to avoid those 4 comparisons to have only 2 (true/false or 1/0)?

    Thanks in advance.

    Nicolas


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


  • 2.  RE: compare boolean in flow service

    Posted Thu March 27, 2014 08:33 AM

    Hi,

    Correct me if I am wrong.

    At run time, what is the value that is expected in the field. Based on that you can do your branch logic.

    Can you share me the screen shot on documentType which shows the content type for the field.


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


  • 3.  RE: compare boolean in flow service

    Posted Thu March 27, 2014 09:26 AM

    Hello,

    At run time, the value can be “1”,“true”,“0” or"false". (as an XML boolean)
    Please find attached a screen shot as requested.
    Capture.PNG


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


  • 4.  RE: compare boolean in flow service

    Posted Thu March 27, 2014 10:24 AM

    I think value ‘1’ is considered as ‘true’ and viceversa. value ‘0’ is considered as ‘false’ and viceversa

    At-least you can two combinations:

    Code something like this

    Branch (Evaluate labels on true)
    MAP %e2%=‘true’ || %e2%=‘1’
    MAP %e2%=‘false’ || %e2%=‘0’

    You can also implement using re-gex but the above code should be fine.

    Let me know if this looks OK.


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


  • 5.  RE: compare boolean in flow service

    Posted Thu March 27, 2014 03:24 PM

    in XML , Legal values for boolean are true, false, 1 (which indicates true), and 0 (which indicates false).
    What Mahesh was saying is correct.


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


  • 6.  RE: compare boolean in flow service

    Posted Thu March 27, 2014 04:37 PM

    Yes the Branch with var substitution to check boolean case should work as true(1) /false (0)…In anycase if you see other than this could be some pipeline issue.

    HTH,
    RMG


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


  • 7.  RE: compare boolean in flow service

    Posted Fri March 28, 2014 05:51 AM

    Thank you all for your answers.
    I came to the same conclusion, but I was hoping that maybe I could use some dedicated functions like $true or $false, or something else :slight_smile:


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