Interface MetamodelApi

interface MetamodelApi {
    createEnumerationLiteral(
        attributePersistentName: string,
        literalName: string,
        literalDescription: string,
        literalColorRGB: string,
    ): boolean;
    createResponsibilityLiteral(
        attributePersistentName: string,
        userEntityId: number,
        literalColorRGB: string,
    ): boolean;
    getAttribute(persistentName: string): Attribute;
    getAttributes(): Attribute[];
    getAttributesAssignedToBuildingBlockType(
        persistentTypeName: BuildingBlockType,
    ): Attribute[];
    removeEnumerationLiteral(
        attributePersistentName: string,
        literalName: string,
    ): boolean;
    removeResponsibilityLiteral(
        attributePersistentName: string,
        userEntityId: number,
    ): boolean;
}

Methods

  • Create a new literal for an existing enumeration attribute

    Parameters

    • attributePersistentName: string

      Persistent name of the enumeration attribute

    • literalName: string

      Name of the enumeration literal

    • literalDescription: string

      Description for the enumeration literal

    • literalColorRGB: string

      Color to associate with the responsibility literal

    Returns boolean

    Whether the literal was successfully added or not.

    // Creates a new enumeration literal "iteratec" for "Manufacturer" with red color
    api.metamodelApi.createEnumerationLiteral("Manufacturer", "iteratec", "", "FF0000");
  • Create a new literal for an existing responsibility attribute

    Parameters

    • attributePersistentName: string

      Persistent name of the responsibility attribute

    • userEntityId: number

      Id of the user or user group to which the literal should refer to

    • literalColorRGB: string

      Hex description of the color to associate with the responsibility literal

    Returns boolean

    Whether the literal was successfully added or not.

    // Creates a new responsibility literal for "Accountability" with red color
    api.metamodelApi.createResponsibilityLiteral("Accountability", user.getId(), "FF0000");
  • Get an attribute object by its persistent name

    Parameters

    • persistentName: string

      Persistent name of the attribute

    Returns Attribute

    The attribute or null if it does not exist

  • Get a list of attribute objects assignable to building blocks of a specific type

    Parameters

    Returns Attribute[]

  • Remove a literal from a enumeration attribute.

    Parameters

    • attributePersistentName: string

      Persistent name of the enumeration attribute

    • literalName: string

      Name of the enumeration literal

    Returns boolean

    Whether the literal was successfully deleted or not.

  • Remove a literal from a responsibility attribute.

    Parameters

    • attributePersistentName: string

      Persistent name of the responsibility attribute

    • userEntityId: number

      Id of the user or user group to which the literal refers to

    Returns boolean

    Whether the literal was successfully deleted or not.