6 Replies Latest reply on May 12, 2011 6:54 AM by aabrodsky

    Hierarchical Model Creation with AF SDK

    scropley

      I am trying to programatically create a base AF Structure

       

      +Registry
          +--Members
              +--Member
                  +--Stations
                      +--PMUs
                          +--Signals
                              +--Signal
                      +--Lines
                          +--Line
          +--Paths
              +--Path
                  +--Line(ref from Member)
          +--Stations (ref from Member)
              +--PMU's
                  +--Signals
                      +--Signal
              +--Lines
                  +--Line
      My question is can AFModels be hierarchical?  How do you create a Model Hierarchy,  so when I go to create A "Station" Element that I should  also create PMUs and Lines child containers?

       

      Model:

       

      StationModel
          +--PMU's
          +--Lines

       

       

        • Re: Hierarchical Model Creation with AF SDK
          andreas

          Not sure if I understand you right. If you just want to create the below structure

           

          4101.Clipboard01.jpg

           

          The answer is yes - if you add an Element to your Model you keep the hirachy.

            • Re: Hierarchical Model Creation with AF SDK
              aabrodsky

              Scott,

               

              Unfortunate answer to your question is no. Currently, you cannot specify in AF, that an element must contain specified child elements in the hierarchy. You can only restrict, what elements you can add as children to the Element. That can be done on a Template level. I am using Reference Types for that, where Reference Strength is "Composition" and select what are the Allowed Parent and Allowed Child templates. Once you do that and delete standard Reference Types, you will see for each templates only allowed "Referenced Parent Templates" and "Referenced Child Templates" in the corresponding menus.

               

               

               

              Regards,

               

              Alex

                • Re: Hierarchical Model Creation with AF SDK
                  scropley

                  PI System Explorer help file shows a screenshot of Hierarchical Templates under the topic Building Hierarchies.  Unfortunately I have not been able to figure out how to create a hierarchical set of templates as shown in the screenshot.  

                   

                  Once the Template Hierarchy is built,  I think I can use that to organize my Elements.

                    • Re: Hierarchical Model Creation with AF SDK
                      aabrodsky

                      Scott,

                       

                      PI System Explorer (in AF Client 2010 R2) will show template hierarchy, if you right click and arrange by either Template Inheritance, or Template References. So you will either see the hierarchy of inherited templates, where children templates inherits attributes of the parent. Or you will see the case, that I described in the previous answer, templates arranged by the Reference Type.

                        • Re: Hierarchical Model Creation with AF SDK
                          cmanhard

                          Alex is correct that by right clicking on the templates, and choosing the option "Arrange By/Template References", you should be able to see your element template hierarchy.  Additionally, can easily create reference types between existing templates by using the "New/Add Template Reference" option on an element template.  I would like to note that we don't recommend using Composition strength except where the total number of elements participating in one composition is relatively small (<100) because composition means the objects will check-in and check-out as one unit.  When large numbers of elements become involved in composition, this will decrease performance as well as the ability to have multiple individuals modifying the elements within.

                            • Re: Hierarchical Model Creation with AF SDK
                              aabrodsky

                              Thanks Chris for pointing out that about Composition type of the Reference, good to know. I'm using different types of references, but when an object with child elements needs to be treated as a whole, I use Composition. Usually it's, for example, a Well element, where children elements are various gauges instrumented on the well.