BoM reference builders#
Record reference builder#
Many types of entity are referenced within a Granta MI database. These references can use several different ways of identifying the target object. The RecordReferenceBuilder helps to ensure that a reference contains the required information and to reduce the risk of ambiguous references being provided.
- class RecordReferenceBuilder(db_key, *, record_uid=None)#
Create a MIRecordReference with a valid combination of properties.
New in version 2.0.
- Parameters:
- with_record_history_id(record_history_id, *, record_version_number=None)#
Specify the record by its history identity, and optionally the version number if the record is in a Version-Controlled table.
- with_record_guid(record_guid)#
Specify the record by its GUID.
This will specify an exact version if the table is Version-Controlled.
- Parameters:
- record_guid
str
The record version GUID.
- record_guid
- Returns:
- _FinalRecordReferenceBuilder
- with_record_history_guid(record_history_guid)#
Specify the record by its History GUID.
This will return the latest released version of the record. If a specific version is required then use the
with_record_guid
method instead.- Parameters:
- record_history_guid
str
The record history GUID.
- record_history_guid
- Returns:
- _FinalRecordReferenceBuilder
- with_lookup_value(*, lookup_value, lookup_attribute_reference)#
Specify the record by a unique value on a short-text attribute.
You must specify both the attribute and the lookup value. If the value is not unique then an exception will be raised.
- Parameters:
- lookup_value
str
The value identifying the record.
- lookup_attribute_reference
MIAttributeReference
The short-text attribute or compatible pseudo-attribute to use for the lookup.
- lookup_value
- Returns:
- _FinalRecordReferenceBuilder
Attribute reference builder#
Records can be referred to by a unique text value, this must be accompanied by a reference to the attribute containing the value. The AttributeReferenceBuilder helps to ensure that this reference contains the required information and to reduce the risk of ambiguous references being provided.
- class AttributeReferenceBuilder(db_key)#
Create a MI Attribute Reference with a valid combination of properties.
New in version 2.0.
- Parameters:
- db_key
str
Database Key specifying the database the Attribute is in.
- db_key
- with_attribute_identity(attribute_identity)#
Specify the attribute by its identity.
- Parameters:
- attribute_identity
int
The attribute’s identity.
- attribute_identity
- Returns:
- _FinalAttributeReferenceBuilder
- as_pseudo_attribute(pseudo_attribute)#
Specify the attribute as a specific pseudo-attribute.
- Parameters:
- pseudo_attribute
PseudoAttribute
- pseudo_attribute
- Returns:
- _FinalAttributeReferenceBuilder
- with_attribute_name(attribute_name, *, is_standard_name=False)#
Specify the attribute by name, which may be a standard name.