Skip to main content

associate_approval

Function associate_approval 

Source
pub fn associate_approval(
    tx: &mut Transaction,
    model: &Model,
    draft: ApprovalAssociationDraft<'_>,
) -> ApprovalResult<EntityId>
Expand description

Validate and stage one rooted approval association.

§Release

Bound to the model’s declared release (#202): the record is laid out by attribute name from that release’s table, and its references are checked against it (RelatedObjects is IfcDefinitionSelect in IFC4 and IFC4X3, IfcRoot restricted by WR21 in IFC2X3). OwnerHistory is left $, which IFC4 and IFC4X3 allow and IFC2X3 does not, so an IFC2X3 model is refused with ApprovalError::AuthoringRequired. Use associate_approval_with_owner_history there.

§Errors

A malformed GlobalId, a relating approval that is not an IfcApproval, an empty, duplicated or out-of-type RelatedObjects; a model that binds no single known release (ApprovalError::MultipleSchemas, ApprovalError::UnsupportedSchema), and an IFC2X3 model. Nothing is staged on an error.