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

Map query result field values to variables.

  • 1.  Map query result field values to variables.

    Posted Mon November 13, 2017 10:13 AM

    Hi WM Gurus,

    I have a simple flow service that query the db (return 4 fields). I mapped them to four variables. Then in the flow service, I loop the result set. I branch on fourth field if it is greater than zero, I will send an email. Send email is inside of sequence of inside of the branch. I was able to use the first three variable values in the email body but not the fourth one. The fourth one just gave me the expression.

    So here is how my email looks like: ODI_Agent_Production_1, PRODUCTION, 13-NOV-2017 14:01:00, %/getMinuteGapOutput/results/MINUTEGAP%

    Any help is really appreciated.

    Franky


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


  • 2.  RE: Map query result field values to variables.

    Posted Mon November 13, 2017 02:10 PM

    Hi Franky,

    when a variable is empty (it does not have a value), it can not be resolved when using in an expression.
    In this case the variable name will remain in the string as shown by you.

    Regards,
    Holger


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


  • 3.  RE: Map query result field values to variables.

    Posted Mon November 13, 2017 02:36 PM

    Thank you, Holger. In my flow, I have a sequence label under the branch: %/getMinuteGapOutput/results/MINUTEGAP% > 0.

    That condition works because it will send out correct emails. So I am confused as how does this expression works but the variables won’t work.

    Attached is the execution results. As you will see, I have values for the fields in result sets: MINUTEGAP, and it is mapped to variable Gap. However, it is just not receiving that value. All other three variable works perfectly.

    I also attached screenshot of my flow service.


    2017-11-13_13-42-42.png


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


  • 4.  RE: Map query result field values to variables.

    Posted Mon November 13, 2017 04:25 PM

    It seems to me that the variable “MINUTEGAP” is of type “Integer”, not “String”. Such variables are evaluated correctly when used in condition expressions but are not resolved when they are referenced as %…% in strings.


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


  • 5.  RE: Map query result field values to variables.

    Posted Mon November 13, 2017 05:27 PM

    Hi fml2,

    Thank you for the explanation. How can I resolve it as string? Any tricks or workarounds?


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


  • 6.  RE: Map query result field values to variables.

    Posted Tue November 14, 2017 07:30 AM

    I’d just set the output type for “MINUTEGAP” to “String” in the JDBC adapter service.


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


  • 7.  RE: Map query result field values to variables.

    Posted Tue November 14, 2017 09:43 AM


  • 8.  RE: Map query result field values to variables.

    Posted Tue November 14, 2017 10:47 AM

    In this case you might need to check your branch condition if it still works correctly.

    You can have the result as Integer and then convert this variable to a string variable before using it in the email body.

    If there is no built-in service (i.e. under pub.string folder) you can check for the WmTransformationServices package available from the download section from TechCommunity.

    Regards,
    Holger


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


  • 9.  RE: Map query result field values to variables.

    Posted Wed November 15, 2017 01:15 PM

    Holger, you rated two posts of mine with four stars. Out of curiosity: why did you give four and not five? Were the replies not quite correct? Or off topic?

    Update: Any news on this?


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