Menu

Relations betweens classes/items

2015-10-17
2015-11-09
  • Sven Willemen

    Sven Willemen - 2015-10-17

    Hey guys,

    The current tutorials are good (add a field to the servers class, creating the monitor class, etc...). Could it be possible someone could create such an example for creating relations between classes?

    An example

    I created a SIM-card class, which works perfectly in my iTop dev-instance. I also have the existing Mobile Phone class. How can i link a SIM-card to a Mobile Phone?

    With regards,

    Sven

     
  • Nadia Bastidas

    Nadia Bastidas - 2015-11-05

    Hi Sven, I'm working on that, what I have till now is a relation between Functional CI and my custom class, in this case is Warehouse, "Almacén" in Spanish. Here is my code and the problem that I have now. It is not a Tutorial but maybe it can help you with the relations between classes. If both of the classes are custom classes I think you can make the relation like in this code. I hope it helps you.

    https://sourceforge.net/p/itop/discussion/922360/thread/a1ecf12c/

     
  • Thiago Arcanjo

    Thiago Arcanjo - 2015-11-09

    You have to create a field in Mobile Phone class like this below:

                <field id="simcard_id" xsi:type="AttributeExternalKey" _delta="define">
                    <sql>simcard_id</sql>
                    <target_class>SimCard</target_class>
                    <is_null_allowed>true</is_null_allowed>
                    <on_target_delete>DEL_AUTO</on_target_delete>
                </field>
                <field id="simcard_name" xsi:type="AttributeExternalField" _delta="define">
                    <extkey_attcode>simcard_id</extkey_attcode>
                    <target_attcode>name</target_attcode>
                </field>
    

    And put the relations after this.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.