2 Replies Latest reply on Dec 23, 2008 2:59 AM by James Andrews

    Referencing Property Sub Class Instances



      Here is the setup. I have a custom property class called Server Config under which I have a subclass for each region we have server i.e. LONDON, NY etc etc, then under that I have subclasses for each class of server within a region with App specific config entries, we then create instances of the bottom level sub-class.


      The Server Config custom class is bound to a property in the Server Property class called (obviously) SERVER_CONFIG


      So (I hope this turns out in the post), this is the class hierachy scenario:


      Server Config CLass

      =======LONDON Sub Class


      ++ LONDON APP 1 Server Config Sub Class -> Instances


      ++ LONDON APP 2 Server Config Sub Class -> Instances



      ======New York Sub Class


      ++ NY APPP 1 Server Config Sub Class -> Instances


      ++ NY APPP 2 Server Config Sub Class -> Instances


      |======ETC ...



      All good so far! So what I want to do is create an Exetended object that references values set in the SERVER_CONFIG property defined in the sub-class instances. However what happens when I try reference the ??TARGET??.SERVER_CONFIG.CONFIGITEM1 setting which is defined in the LONDON APP 1 instance of the London App 1 sub-class. I get an error saying the Server class doesnt contain a property called CONFIGITEM1. I also can't browse to that setting as it is hidden within the subclass not at the top level of my SERVER_CONFIG property.


      I have read the documentation and it appears that this is the way we should be doing this and this is the way the documentation says it should work, however when creating the extended object I have no access to the subclassed property settings.


      Where am I going wrong? How can I expose subclassed property instances to extended objects etc?


      Help greatly accepted!




        • 1. Re: Referencing Property Sub Class Instances
          Bill Robinson

          I see the same thing - you can only see the properties in the class you directly reference, and you cannot see the subclass of the referenced class.


          if your SERVER.SERVER_CONFIG class was a reference to the CUSTOM.SERVER_CONFIG.LONDON_APP1 class, then you would likely see the CONFIGITEM1 setting.


          can you bring the apps up 1 level, so under CUSTOM.SERVER_CONFIG you have instances of all of the applications across all environments?

          • 2. Re: Referencing Property Sub Class Instances



            We could do as you suggest, however the situation we have a is multiple configurations per location and muliple apps per location so subclassing is the ideal way to allow each location to have thier own server config instance.


            As you say you can't directly access the the subclasses, which is a shame, but understandable.


            I figured out how to do it. I created this jython function:


            def getConfigPropertyValue(_serverName,_config_Property):

            cmd =

            returnObject = jli.run(cmd)


            sPropertyInstance = returnObject.returnValue


            cmd =

            returnObject = jli.run(cmd)


            return returnObject.returnValue


            Which will return any property setting for an instance assigned to the SERVER_CONFIG property. I then use this function is my Extended Objects to grab the config settings on the fly, I also use a similar function for setting the values on the fly as well.


            Thanks for your help! Hopefully that code snippet is of use to someone else as well!