To recap, when writing or reading instance data, there are a few things that need to be considered:
-
First and foremost, instance data is expressed as ECXML fragments and must conform to the schema to be published with the data to the i-model.
-
Every class instance must have a unique instanceID within the context of the class. Instances of different class can have the same instanceID assigned. As an example, two instances of the Company class must have unique instanceIDs, whereas, an instance of the Company and Project class can have the same instanceID.
-
Relationships are always defined between two class instances defined by their corresponding instanceIDs.
-
Relationships must also have instanceIDs assigned to them and must be unique within the context of the relationship class.
-
Relationships instanceID can be any string but is typically formulated by concatenating the source and target instanceIDs.