Interface BuildingBlock

declare interface to single Building Blocks of the datamodel

interface BuildingBlock {
    addValue(propertyPersistentName: string, value: AttributeValue): boolean;
    clearValues(propertyPersistentName: string): boolean;
    connect(object2: BuildingBlock, relationendPersistentName: string): boolean;
    disconnect(
        object2: BuildingBlock,
        relationendPersistentName: string,
    ): boolean;
    getId(): number;
    getPropertyInfo(propertyPersistentName: string): PropertyInfo;
    getRelatedObject(relationEndPersistentName: string): BuildingBlock;
    getRelatedObjects(relationEndPersistentName: string): BuildingBlock[];
    getValue(propertyPersistentName: string): AttributeValue;
    getValues(propertyPersistentName: string): AttributeValue[];
    remove(): void;
    removeValue(propertyPersistentName: string, value: AttributeValue): boolean;
    setValue(propertyPersistentName: string, value: AttributeValue): boolean;
    setValues(
        propertyPersistentName: string,
        values: AttributeValue[],
    ): boolean;
}

Methods

  • For multi value properties, adds the value to the value array. Works only if the value is not already contained.

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    • value: AttributeValue

      New value to add

    Returns boolean

    Whether the operation was successful.

  • Unsets the value for an attribute

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    Returns boolean

    Whether the operation was successful.

  • Connects an object to the other object via a relation of the given type. If an object can have only one relation an earlier relation is replaced. The objects are connected in both directions.

    Parameters

    • object2: BuildingBlock

      Second Building block to connect to

    • relationendPersistentName: string

      Persistent name of the relationship end to connect to

    Returns boolean

    Whether the operation was successful.

  • Disconnects an object from the other object.

    Parameters

    • object2: BuildingBlock

      Second Building block to disconnect from

    • relationendPersistentName: string

      Persistent name of the relationship end to disconnect from

    Returns boolean

    Whether the operation was successful.

  • Id of the building block

    Returns number

  • Gets inner properties of Building Block attribute by its persistent name (mandatory, multiple and type attribute properties are available)

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    Returns PropertyInfo

  • Get the assigned object for a single assignment relation, does not work for multi assignment relations.

    Parameters

    • relationEndPersistentName: string

      Persistent name of the relation end

    Returns BuildingBlock

    The related building block or null if no building block exists on the relation end

  • Get an array of objects for a multi assignment relation, does not work for single assignment relations.

    Parameters

    • relationEndPersistentName: string

      Persistent name of the relation end

    Returns BuildingBlock[]

  • Get the value for a property that can have only a single value. Does not work for multi value properties.

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    Returns AttributeValue

  • Get the array of values for a property that can have more than one value. Returns empty array if no values are assigned. Does not work for single value properties.

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    Returns AttributeValue[]

  • Removes the corresponding Object from the model.

    Returns void

  • For multi value properties, removes the value from the value array. Works only if the value is contained.

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    • value: AttributeValue

      Existing value to remove

    Returns boolean

    Whether the operation was successful.

  • for single value properties, replaces the current value with the new value

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    • value: AttributeValue

      New value to set

    Returns boolean

    Whether the operation was successful.

  • For multi value properties, replaces the current value array with a new array of values

    Parameters

    • propertyPersistentName: string

      Persistent name of the attribute

    • values: AttributeValue[]

      New values to set

    Returns boolean

    Whether the operation was successful.