5 Replies Latest reply on Mar 21, 2014 7:46 AM by Chris Jones

    AR Filter Plugin

      Share This:

      Hi,

       

      Can anyone explain me the step by step process of creating AR Filter API Plugin? I read the BMC Documents like C API and integration guide. From there i understood that, AR Plugin has to be written in C Programming Language and has to be compiled. And the compiled C Program has to be placed inside the plugin server. ...Ok

       

      Now, our requirement of having a plugin is to query an external database for a list of records......And to set this details into a form by using SET FIELD Action. I just need a sample api plugin for the reference and i would like to create in the same line.

       

      Also please mention the technical tools to compile, run the C programs.

       

      OUR ENVIRONMENT: [ AR System Server 7.0.1 / Oracle 10g / Sun OS ]

       

      Please help me in this regard.

       

      Cheers,

      Imran

        • 1. Re: AR Filter Plugin
          Rakesh Jajper

          Hi Kindly Check in CAPI Reference guide

          You will get the skeleton and various API functions in the same guide.

           

          Rakesh

          • 2. Re: AR Filter Plugin

            Thanks Mr. Rakesh, but i wanted a little bit more technical resource. As per the document, the following functions has to be implemented in a plugin.

            1. ARPluginIdentify ()
            2. ARPluginSetProperties ()
            3. ARPluginInitialization ()
            4. ARPluginCreateInstance ()
            5. ARPluginDeleteInstance ()
            6. ARPluginTermination ()
            7. ARFilterApiCall()

             

            Now, all the above functions are implemented in my program & the core functionality is defined under ARFilterApiCall(). And the whole code is bundled under API_Demo.C

             

            I have doubt here.

            -------------------------------------

            1. Where to define the main() ?

            2. How to compile this program to make a plugin in Sun Solaris Environment.

             

            Your help will be very useful.

             

            Thanks!

            Imran

            1.  

            • 3. Re: AR Filter Plugin

              Hi Emran,

               

              In a plugin there is no main function per se.  The Remedy plugin-server (aka. the ARS Server) will call the function "void ARFilterApiCall()" which you should expose.  This exposed function will be called by the Remedy plugin server each time your plugin is invoked from a Remedy Filter - Set Fields or Run Process action.  So in a sense the exposed function "void ARFilterApiCall()" is the main function of your program. 

               

              I know you said you have reviewed the documentation but have you looked at the sample code Remedy provides with the API?  It is under the API directory on your Remedy server directory.  The file containing the code is titled "arfilterapisamp.c".

               

              I hope this helps,

               

              Mike Ellertson

              • 4. Re: AR Filter Plugin
                Sivapriya Sivaprakasam

                Hi,

                 

                In this filter API Plugin we do have ARPluginInitialization () call where the Server name, Port no, User name and password are hard coded. Because of this every time we go to a new server we should recompile the program. Is that possible to externalize those values?

                 

                Kindly let me know.

                 

                Regards,

                Sivapriya

                • 5. Re: AR Filter Plugin
                  Chris Jones

                  Hi Sivapriya,

                   

                  You need to use the ARPluginContext (arpc) object passed into the plugin to get these values.

                   

                  Use arpc.getUser() to get the username

                   

                  You can also make use of arpc.getUserSessionGUID()

                   

                  To get the Server name, use this method:

                   

                  /*

                    * Get the server name from the Pluginsvr command line args

                    */

                    private String getServer(ARPluginContext arpc) {

                    String[] args = arpc.getCmdLineArgs();

                   

                    for (int i = 0; i < args.length; i++) {

                    if (args[i].equals("-x")) {

                    return args[i+1];

                    }

                    }

                    return "";

                    }

                  Hope this helps

                   

                  Chris