This information is intended for users who have experience with scripting.


If you are using scripts in your ArchiMate® models and want to use metrics in these scripts, metric functions are available to access and modify the values of these metrics. This is different from attribute values, which are accessed and modified via methods on the object to which the attributes belong.

The metric functions described below are part of the ArchiMate.metrics library, a component of the Enterprise Studio installation. In order to use a metric function in Enterprise Studio, it has to be called as follows:

ArchiMate.metrics:metricValue(..).

An alternative way is to use an alias for the library name:

using metric for ArchiMate.metrics;
ok = metric:metricValue( .. );


The metric functions are NOT part of the Bizzdesign scripting language, therefore they are not included in the Bizzdesign Scripting Reference.


The following script functions are available:

metricValue function

The function metricValue allows you to retrieve the value for some metric of some object.

<result> = metricValue( < object, metric, byref value > )

<object>

A value of the type Object.

<metric>

A value of the type ArchiMate:MotivationMetric.

<value>

A variable of any type. The attribute value is returned in this variable, if possible.

<result>

A boolean: Indicates whether a metric value is returned in variable <value>, or not.


An example of a call to function metricValue is given below.

using metric for ArchiMate.metrics;

object = <obtain reference to object>
metric = <obtain reference to metric>
value = undefined;
ok = metric:metricValue( object, metric, value );
if ( ok ) {
   // Use value
   message "Value " + value.toString()
                + " is defined for metric "
                + metric.toString();
} else {
   // Attribute has no value
   message "No value has been defined for metric "
                + metric.toString();
}

hasMetricValue function

The function hasMetricValue allows you to check whether a value has been defined for some metric of some object.

<result> = hasMetricValue( < object, metric > )

<object>

A value of the type Object.

<metric>

A value of the type ArchiMate:MotivationMetric.

<result>

A boolean: Indicates whether a metric value is defined, or not.

setMetricValue function

The function setMetricValue allows you to set (define) the value for some metric of some object.

<result> = setMetricValue( < object, metric, value > )

<object>

A value of the type Object.

<metric>

A value of the type ArchiMate:MotivationMetric.

<value>

A value that conforms to the datatype set in the definition of the metric.

<result>

A boolean: Indicates whether the value is set, or not.

removeMetricValue function

The function removeMetricValue allows you to remove the value for some metric of some object.

<result> = removeMetricValue( < object, metric > )

<object>

A value of the type Object.

<metric>

A value of the type ArchiMate:MotivationMetric.

<result>

A boolean: Indicates whether the metric value is removed, or not. In case no value was defined, the value is assumed to be removed.

ArchiMate® is a registered trademark of The Open Group.