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

Setting variables in a Java CFX tag

  • 1.  Setting variables in a Java CFX tag

    Posted Thu July 31, 2003 05:58 PM

    OK, I can set a simple variable using response.setVariable. I can set a struct. I can set an array. I can set an array of arrays. I can set an array of structs. Here is a code snippet to demonstrate how I do each of these:
    <p>
    // set a plain old variable<br>
    response.setVariable(“variable”, “value”);
    <p>
    // set a simple struct<br>
    response.setVariable(“struct.element1”, “value1”);<br>
    response.setVariable(“struct.element2”, “value2”);<br>
    response.setVariable(“struct.element3”, “value3”);
    <p>
    // set an array<br>
    response.setVariable(“array[1]”, “”); // create the array<br>
    response.setVariable(“array[1]”, “value1”);<br>
    response.setVariable(“array[2]”, “value2”);
    <p>
    // set an array of arrays<br>
    response.setVariable(“arrayofarrays[1][1]”, “”); // create the array<br>
    response.setVariable(“arrayofarrays[1][1]”, “value1”);<br>
    response.setVariable(“arrayofarrays[1][2]”, “value2”);<br>
    response.setVariable(“arrayofarrays[2][1]”, “value3”);<br>
    response.setVariable(“arrayofarrays[2][2]”, “value4”);
    <p>
    // set an array of structs<br>
    response.setVariable(“arrayofstructs[1]”, “”);<br>
    response.setVariable(“arrayofstructs[1]["key1"]”, “value1”);<br>
    response.setVariable(“arrayofstructs[1]["key2"]”, “value2”);<br>
    response.setVariable(“arrayofstructs[2]["key3"]”, “value3”);<br>
    response.setVariable(“arrayofstructs[2]["key4"]”, “value4”);<br>
    response.setVariable(“arrayofstructs[2]["key5"]”, “value5”);
    <p>
    These all work fine. But for the life of me I can’t figure out how to do what I need to do, which is set an array as an element of a struct. I know CF can do that - I can create one using the cfset tag, but I cannot figure out how to do it from a Java cfx tag. Help!!


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


  • 2.  RE: Setting variables in a Java CFX tag

    Posted Thu July 31, 2003 06:45 PM

    Ooops! Sorry - this message was meant for the ColdFusion forum. The webMethods end of this problem is working fine…


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