Service Virtualization

  • 1.  Is there a concept of setting instance based variables in CA SV?

    Posted Feb 09, 2018 09:50 AM

    HI All,

     

    I have a requirement in which once a request comes ,I need to extract some request parameters and set them as DevTest Properties (using testExec.setStateValue method) so that they can be used when some other request comes and need their value.

     

    I am able to achieve this functionality now however one problem that I am facing is that the value of Devtest property is overridden if another request comes before the request where I intend to use this set Devtest property and hence it overrides the previous value.

     

    So I would like to ask if somehow I can set Devtest property(variable) on instance basis so that the value is identified by some instance and even if multiple requests come in between ,still the correct value is returned when required.

     

    Any help on this topic is much appreciated.

     

    Thanks

    Sarthak Gupta



  • 2.  Re: Is there a concept of setting instance based variables in CA SV?

    Posted Feb 09, 2018 11:38 AM

    Hi,

         I think DevTest properties hold current and previous state values only.If you want to use values based on the request, log the request parameter values into DB and extract the values from DB as you need them.

                                                      Thanks,

    Vish



  • 3.  Re: Is there a concept of setting instance based variables in CA SV?

    Posted Feb 09, 2018 11:07 PM

    Hi LearnNow,

    Thanks for your suggestion.It looks promising.May i know if there is some documentation on using DB to achieve this as I couldnt find any.

     

    Thanks

    Sarthak



  • 4.  Re: Is there a concept of setting instance based variables in CA SV?

    Posted Feb 09, 2018 04:33 PM

    Read over this thread thoroughly.  Passing values between services It applies to passing values between services, but the same technique applies to one service retaining values. 

    You are going to need to implement some sort of storage mechanism for these values be it database table, persistent model, or shared model. 

    As an aside, are you able to use conversational model rather than a stateless model to accomplish the same?



  • 5.  Re: Is there a concept of setting instance based variables in CA SV?

    Posted Feb 09, 2018 11:06 PM

    Hi Joel,

     

    Thanks for your suggestion.I have used shared model map earlier however I was reading one of your reply in the mentioned thread where you mentioned 

    "Shared Model Maps consume VSE memory. This technique should not be used for 'general storage' or as a work area for models."

    Hence I would like to ask if we can use devTest Database for storing these values and parameters (if it is advisable) and is there any documentation on the same.

    Thanks



  • 6.  Re: Is there a concept of setting instance based variables in CA SV?

    Broadcom Employee
    Posted Feb 11, 2018 11:35 AM

    The Persistent Model Map uses the DevTest database as its storage, so that might be the approach you want to take.



  • 7.  Re: Is there a concept of setting instance based variables in CA SV?
    Best Answer

    Posted Feb 10, 2018 08:19 AM

    Hi,

     

    If you want to use Database to store the data follow the below process,

    1. If you are already using Enterprise database for your DevTest then create a dedicated table over there

    2. In your Virtual Service (VSM1) use a SQL Database Execution step and pass the query which inserts the required records into DB

    3. In Virtual Service (VSM2) where you want to retrieve the inserted records use again SQL Database Execution step, consume those in the VS

    Refer the below link to configure SQL Database Execution step, 

    SQL Database Execution (JDBC) - DevTest Solutions - 10.2 - CA Technologies Documentation 

     

    But if your Virtual Services reside in the same  VSE then you can use SharedModelMap 

     

    Best Regards,

    Venkat Yedida