Layer7 API Management

 View Only
  • 1.  Custom assertion choose variable names

    Posted Apr 29, 2016 09:46 AM

    The Interfaces UsesVariables (i.e. method getVariablesUsed) and SetsVariables (i.e. method getVariablesSet) declare the variables used and modfied by a custom assertion.

     

    I want to be sure that my custom assertion does not use/overwrite variables unintentional. Therefore I use a "namespace" like myassertion.variablename. Even better would be when the user of the assertion can choose the variable names by himself. Like in the Split Variable assertion where I can choose a source and target variable.

     

    How would I implement this? I see the use of a variable prefix in the Salesforce example. Would it be possible to post parts of the Split variable assertion to have an example for this?

     

    Thanks

    Stephan



  • 2.  Re: Custom assertion choose variable names
    Best Answer

    Posted May 11, 2016 07:33 AM

    Wow, seem to have a lot of custom assertion developers here

     

    Well, if somebody will have the same problem, you have to use a CustomTargetVariablePanel in the assertion UI. That creates a textbox with an icon so that the user has instant feedback about the variable name (for example: OK (overwrite)). This way the user can choose the target variable name and gets an automatic feedback if the choosen name is new or overwrites an existing variable etc.

     

    Stephan