CA Service Management

 View Only
Expand all | Collapse all

Null Input Variable values in Catalog Plug-in

  • 1.  Null Input Variable values in Catalog Plug-in

    Posted Mar 13, 2015 08:38 AM

    I am trying to use a plug-in to load a couple of field.  We have written the code in the plug-in to be flexible based on input values.  A couple of which are supposed to be hard-coded in the Plug-in Variable to determine what information is brought back to the select field.

     

    In the variable field I have tried 2 different ways to format what is going in.

    $({'userid':_.user.id,'envlevel':'prod','querytype':'hostname'})

    $({'userid':_.user.id},{'envlevel':'prod'},{'querytype':'hostname'})

     

    Here is the setInputs method I am using.

      public void setInputs(Map<String, Object> inputs) {

         // getting input from plugin call/variables

         envLevel = (String) inputs.get("envlevel");

         log.trace("Environment Level =" + envLevel);

         queryType = (String) inputs.get("querytype");

         log.trace("Query Type =" + queryType);

         userID = (String) inputs.get("userid");

         log.trace("User ID =" + userID);

       }

     

    Here is the log with the null value. I am getting a null exception after this because I am trying to do something with the variables.

    2015/03/12 17.20.24.028 TRACE [http-8080-12] [SelectPlugin] Environment Level =null

    2015/03/12 17.20.24.028 TRACE [http-8080-12] [SelectPlugin] Query Type =null

    2015/03/12 17.20.24.028 TRACE [http-8080-12] [SelectPlugin] User ID =null

     

    What am I doing wrong?  I am sure it is how I am formatting the Plug-in Variables.  The examples I have seen only have 1 variable and it is always the userid.



  • 2.  Re: Null Input Variable values in Catalog Plug-in

    Posted Mar 31, 2015 11:43 AM

    Can anyone help Paul out?

     

    Thanks