Define a dependency
Prerequisite: You must be familiar with the
Syntax used in Tutorials and
have already created an
extension.
- learning:
- Define an impact analyses relationship between classes
- level:
- Intermediate
- domains:
- XML, Impact Analyses
- min version:
- 2.1.0
In this tutorial, we will see how you can define a new dependency relationship between iTop classes
Let's assume you have created a new class “Truc” under FunctionalCI, and that class is impacting an ApplicationSolution or a BusinessProcess. In addition you want that impact to depends on a rule which is diiferent for each Application Solution and BusinessProcess, so for one particular Business Process, maybe juste one Truc must be up, while for another, 75% of the Trucs must be up.
- itop_design / classes
-
<class id="Truc" _delta="define"> <parent>FunctionalCI</parent> <properties>...</properties> <fields> <field id="functionalci_id"xsi:type="AttributeExternalKey"> <sql>functionalci_id</sql> <filter><![CDATA[ SELECT FunctionalCI WHERE finalclass IN ('ApplicationSolution', 'BusinessProcess') ]]></filter> <target_class>FunctionalCI</target_class> <is_null_allowed>true</is_null_allowed> <on_target_delete>DEL_MANUAL</on_target_delete> <tracking_level>all</tracking_level> <allow_target_creation>true </allow_target_creation> </field> </fields> <relations> <relation id="impacts"><-! This id has to be called "impacts" to be used in impacts analyses --> <neighbours> <neighbour id="business"><-! Any name is fine --> <-! Specifying an ExternalKey is the simplest way to specify a dependency --> <-! It can also be a LinkedSet or a pair of queries (downward and upward) --> <attribute>functionalci_id</attribute> </neighbour> </neighbours> </relation> </relations> </class> </class id="FunctionalCI" _delta="merge"> <fields> <field id="trucs_list" xsi:type="AttributeLinkedSet" _delta="define"> <linked_class>Truc</linked_class> <ext_key_to_me>functionalci_id</ext_key_to_me> <count_min>0</count_min> <count_max>0</count_max> <edit_mode>add_remove</edit_mode> <duplicates/> </field> <field id="redundancy" xsi:type="AttributeRedundancySettings" _delta="define"> <sql>redundancy</sql> <relation_code>impacts</relation_code> <from_class>Truc</from_class> <neighbour_id>business</neighbour_id> <enabled>true</enabled> <enabled_mode>user</enabled_mode> <min_up>1</min_up> <min_up_mode>user</min_up_mode> <min_up_type>count</min_up_type> </field> </fields> </class id="BusinessProcess" _delta="merge"> <presentation> <details> <items> <item id="trucs_list" _delta="define"> <rank>110</rank> </item> </items> </details> </presentation> </class> </class id="ApplicationSolution" _delta="merge"> <presentation> <details> <items> <item id="trucs_list" _delta="define"> <rank>110</rank> </item> </items> </details> </presentation> </class>
Fields of type
AttributeRedundancySettings
don't have to be added to
the <presentation>, they are automatically displayed on the
corresponding tabLimitation: defining
AttributeRedundancySettings
and
AttributeLinkedSet
fields on another class than the
one pointed by the <attribute> within the <neighbour>,
such as ApplicationSolution and BusinessProcess does not work3_0_0/customization/neighbours.txt
· Last modified: 2022/01/21 16:52 by 127.0.0.1