Service Virtualization

  • 1.  Getting the Matched Transaction ID

    Posted Nov 15, 2018 11:46 AM

    I'm trying to get the ID of the matched response for use in a JDBC step parameter.  Is there an existing variable reference I can use?  I have not been able to find any good lists of all of the {{variables}} that are available for use.

     

    Thanks,

     

    Jeff Tucker



  • 2.  Re: Getting the Matched Transaction ID
    Best Answer

    Posted Nov 15, 2018 07:13 PM

    There's a property called {{lisa.vse.matched.transaction}}, which is available and populated after the VS Image Response Selection step is executed. This property is a reference to our internal com.itko.lisa.vse.stateful.model.Transaction java object. You can call the following method on the object to get the transaction id: com.itko.lisa.vse.stateful.model.Transaction.getId();

     

    So you can add an "Execute Script (JSR-223)" step right after "VS Image Response Selection" and add the following code:

     

    import com.itko.lisa.vse.stateful.model.Transaction;

     

    Transaction transaction = testExec.getStateObject("lisa.vse.matched.transaction");
    long id = transaction.getId();

    testExec.setStateValue("matchedID", id);

     

    You can then dereference {{matchedID}} in JDBC step