Data block definitions form the basis for data blocks, sets of attributes available on diagrams, views, objects or relations in Horizzon that can be used for model data enrichment and that can be edited by Contributor users. 

Data block definitions are created in a Connection model in a model package. The definitions only apply to that model package, and the associated data blocks in Horizzon are only available in sites based on that model package. If you need data blocks in sites of different model packages, you will need to create data block definitions in each of these model packages. Data blocks are bound to the model package (and its sites) they are defined in.

Data block definitions can be defined for an object type of any metamodel. This object type can be a type of diagram, view, object or relation (all parts of a model package are considered an object). Once available in a Horizzon site, the associated data blocks will be available on all diagrams, views, objects and/or relations of the specified type. A single data block definition can be created for multiple object types.

It is possible to create multiple data block definitions in one model package.

Data block definitions are uploaded to the central data block store to make the associated data blocks available in Horizzon.

Required roles

Designer or Lead Designer


On this page:


Creating a data block definition

  1. Open the model package from Horizzon to which you want to add data block definitions, and add a Connection model.

    In the model browser, right-click the model package, point to
    New > Connection model , and then click 1. Empty model with connection view. A new Connection model  containing a connection view and Connections container, appears in the model browser.

  1. If you create a new model package, make sure to save the model package on Horizzon before you start adding data block definitions, otherwise the connection with the data block store cannot be made and you will receive an error message.

  2. Right-click the Connection model, and select New > Data block definitions. A new data block definitions view is added to the model.

      

  3. Click the data block definitions view to open it, and add a data block definition to the view using the Create pane or the quick-create pop-up window.



  4. Select the data block definition, click  to open its properties window, and on the Properties tab, set the following:

    1. In Label, enter the name of the data block as it should be presented in Horizzon. It will be the data block title.

       

    2. The definition's name and namespace together identify the data block definition. The combination namespace+name must be unique across all data block stores on the server. Initially, both values are implicitly set, meaning that they have a default, however real, value. Determine whether you want or need to explicitly set them or not:

      If name is implicitly set (value is derived from Label), each time you change Label, name will automatically change with it. To add the label change to the data block store, the definition can only be uploaded as a new data block definition to the data block store.

      If name is explicitly set (name must differ from the label), it will not automatically change when Label is changed. To add the label change to the data block store, the existing definition can be updated. If you explicitly set a name, keep in mind that only lowercase letters, hyphens ( - ), and underscores ( _ ) are allowed to use.

      If Namespace is implicitly set, its value is "default". It can be explicitly set for grouping data block definitions, or it may be needed for identification in the data block store to create a unique combination with name. If Namespace is explicitly set, each time you change it, you need to upload a new copy of the definition to the data block store. You cannot update the existing definition.


      If, after setting the name or namespace an error message appears, it means that the model package you are working on is not yet stored on Horizzon. You first need to save it to Horizzon before you can proceed.


  5. Assign one or more object types to the data block definition. It can be a type of diagram, view, object and/or relation. The data block will be available on all diagrams, views, objects, and/or relations of the chosen type(s). You can link the data block definition to object types of different metamodels.

    Only concrete types can be assigned, like an ArchiMate application component, BPMN task, or UML class diagram. You cannot assign abstract types like "mm_object". If you assign an ArchiMate object type that has specialized objects, the data block will also be available on these specializations.

    To add a type, either drag an existing object from the model browser onto the title bar of the data block definition, or enter the type name in Object types in the Types tab.
    To enter a name, type the metamodel name followed by a colon and the name of the object type. Use the type id or name of the object type. For more information about finding the type name of an object, please refer to Finding element type names.

    Example: ArchiMate:ApplicationComponent

    Please take note that the name is case sensitive.

  6. By default, two attribute fields are added when creating a new data block definition. Depending on what you need, you can add additional fields by clicking  at the right top of the definition, or remove a field if you don't need it by selecting the field and clicking . Specify each attribute field:

    1. Select a field, click to open its properties window.

    2. In Label, enter the name of the attribute field as it should be presented in the data block in Horizzon.

    3. The value of name is automatically filled and derived from Label, but you may need to change it:
      - The name identifies the attribute field and must be unique within the data block store. There cannot be two attributes with the same name in all data block definitions within the same data block store.
      - The attribute name must differ from any data block definition name in the data block store.
      - The attribute name must differ from any default attribute name of the object type the data block definition is assigned to. For example, the Work package object type has a default attribute called "costs". If the data block definition is assigned to the Work package object type, do not name a data block attribute "costs". For the label it's fine, but not for the name. 

      If you change the name, keep in mind that only lowercase letters, hyphens ( - ), and underscores ( _ ) are allowed to use.

       

    4. In Type, select the data type of the field. Depending on the type you choose, you may need to set additional properties.

       

      The following data types are available. Click a type for more information.

      Plain text, multiple lines allowed.


      Formatted text, multiple lines allowed.


      Value is true or false.


      Numerical value with decimal points.


      Whole numerical value.


      Date value.


      Money value.

      If you select "money", then also select the desired currency in Currency.


      Closed list of self-defined values.

      If you select "enumeration", then also enter values in Type name and Literals:

      In Type name, enter a name for the enumeration list. It is for defining the list. The name is for possible reuse of the list in other fields within the data block definition.

      If you want to reuse an enumeration list that has already been defined in another attribute field within the same definition, then enter the type name of that enumeration list. The associated list options will automatically be added to Literals. You do not have to manually add them.

      In Literals, add the labels and names for the list options users can choose from when editing the data block field in Horizzon. The labels are the names of the options as presented to the user. Name values are automatically derived from the labels, but they can be changed. The names can be used for condition expressions in scripts, if desired. An example:

      You can rearrange the added literals by clicking the next to a value and drag it up or down to the desired position.

      Initially, a data block with enumeration values in Horizzon is empty. Once a value has been set, the field cannot be emptied anymore. One can only select one of the other available values from the list. If you want to have the ability to "empty" the data block field, you can choose to add an additional option to the enumeration list that represents an unset value or that visually empties the field:

      To add an option to represent an unset value, you can, add a literal named Not set or other appropriate name. Example:

      If you want the field to look empty, add a literal named <Default> or other appropriate name, but put it between the triangle brackets. They will make the value disappear when saved in the data block. Example:

      Please take note that when using the triangle brackets option, the value will be visible when using the (read-only) data block values in Enterprise Studio again.

      Closed list of existing model objects of a particular type.

      If you select "reference", then also specify the object type(s) in Object types. Enter the type name of the objects that need to be available in the selection list and press Enter. When adding multiple types, new entry fields will be added automatically.

      To enter a name, type the metamodel name followed by a colon and the name of the object type. Use the type id or name of the object type. For more information about finding the type name of an object, please refer to Finding element type names.

      Example: ArchiMate:ApplicationComponent

      Please take note that the name is case sensitive.


    5. If you want the attribute field to be a list field so that multiple values can be added to the field when used in Horizzon, click the cross next to Is list. All data types can be defined as a list except types text and Boolean. In List type name, enter a name for the list. It is needed for identification of the list. An attribute field that is defined as a list can be recognized by the square brackets [] next to the field name. Example of an attribute field defined as a list:

       

    6. If you want the attribute field to be a calculated field, click the cross next to Is calculated to enable calculation. Only a field of data type real, integer, money, or enumeration can be set as calculated field. In Expression, enter the expression that specifies the calculation of the field. For more information, please refer to Using calculated fields in data blocks. Example of an attribute field defined as a calculated field:

      For defining calculated fields it is assumed that you have some familiarity with scripting.

  7. When you are ready defining the attribute fields, open the definition properties window again, and click Upload in the Data block store tab to upload the new data block definition to the data block store.


The data block is now available for editing in Horizzon sites that are based on the model package the data block is created in:


Updating data block definitions

Data block definitions can be changed and updated any time. Depending on the type of changes that you make, the existing data block definition can be updated, or a new copy of the definition needs to be uploaded. For example, changing the namespace of the data block definition or changing the label name of an attribute field in the definition will result in a new definition, meaning that you have to upload a new copy of the definition.

Please note that if a new copy of the definition needs to be uploaded, existing data blocks in Horizzon that are based on the previous version of the definition, will be affected. Existing data block values may get lost. A few examples:

If the label name of an attribute field has changed, the respective field in the existing data blocks in Horizzon will be emptied after uploading the new data block definition.

If you copy a data block definition from one model package to another to use it there, make sure to give the new copy of the definition a unique combination of namespace+name. If you don't, values in the data block fields in Horizzon based on the original data block definition will get lost when you upload the new copy of the data block definition to its data block store.

If the table with data block definitions is open while making changes to a data block definition and uploading it, the table will not automatically be updated. To see the data block definition changes in the table, you need to close the table and reopen it.

Sorting of data block definitions in Horizzon

When multiple data block definitions are defined for a single object type, the associated data blocks will be shown below each other in the properties panel of an object of that type. They are sorted alphabetically based on their namespace+name combination (in that order), not based on their label. Only explicitly setting the namespace for each definition would suffice to determine their order. Please take note that the implicitly set "default" namespace value and default name value will also be included when determining the order, although implicitly set, they are considered to be a value. Example:

When using only the default namespace, the following data block definitions would be shown in the following order in Horizzon:


  


To get the desired order "cost, quality, editor", the namespace of the definitions has been as follows: