New topics covered by this example:
- Attaching imported data to objects already existing in the model
- Importing recursive hierarchies of objects (i.e. hierarchies with unknown depth)
The inputs for this example are:
- The Excel file which you can see below
- The Rule Maker template (you can ask for it at firstname.lastname@example.org)
Target project type diagram:
The problem of importing recursive hierarchies
This tutorial will explain how you can import the recursive hierarchy specified in the Excel file above with the Model Gateway. The main difficulty here is that the top objects of the hierarchy, here System 1 and System 2, do not have a defined parent object. We will explain the issue through two naive attempt at importing the hierarchy.
Attempt #1: Using a single parent relation
We start with a very simple and minimalist Rule Model Sheet (see picture below) with only two Rule Columns and a Parent Of relation.
When we try to import the Excel file using this Rule Model Sheet, the Model Gateway does not import anything and complains that it was not able to connect any of the imported object to the project root.
Attempt #2: Adding a relation from root to Sytem Parent
Since attempt #1 failed because our top object could not be connected to the root, it seems logical to add a Parent Of relation between the root and System Parent as in the Rule Model Sheet below:
Alas the result is still not what we desire, this time the problem is that the Model Gateway adds all System Parent object under the project root:
Importing recursive hierarchies using the default relations
The default relations (see the reference documentation) are similar to the normal relations at the exception that they are only taken into account for object which do not have at least on identified parent which is exactly the case of hierarchy's top objects.
Thus with the following Rule Model Sheet we instruct the Model Gateway to only create a relation between the project root and the System Parent object which do not have any parent:
And the final result is the one we expected:
Importing the hierarchy at a specific location
We have seen how to import the hierarchy directly under the project root, but what if we need to import it in a subsystem ?
In this case we can use a VirtualColumn with a default value to create the subsystem and use it as the hierarchy root (it may also already exist in the