Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Measure Implementation

Prasoonda edited this page Sep 8, 2017 · 8 revisions

Measure Implementation Overview

SMM Measures are implemented in Java. The implementation appears as a jar file which contains a compiled Java application developed using services provided by the SMMMeasureApi library.

Generate a Maven Project from Measure Specification

It is possible to generate a Maven implementation project directly fram a measure specification in the Modelio project. To generate an implementation project :

Go to the menu Configuration -> Modules... It will open the Project configuration with the Modules tab selected. Select Java Designer by ModelioSoft , go to its parmeters Directories -> Sub path for Java Components and empty the value of this parameter.

  1. Select your measure in the Model Explorer [1]
  2. Generate the project [2]: Right-click -> SMM Designer -> Generate Measure.
  3. The Java implementation project has been generated on the project space of the Modelio project.

Implement the Measure with Eclipse IDE.

Open the implementation project in Eclipse IDE

The generated implementation project is a maven project.

In Eclipse, the project can be imported as an existing Maven project:

  1. File -> Import -> Maven -> Existing Maven Project.
  2. Select the directory in which the implementation project has been generated [1].
  3. In the Projects list, select the pom.xml corresponding to your measure [2].
  4. Click on Finish to import the project [3].

Visualise the MeasureMetadata.xml file

The MeasureMetadata.xml file has bean generated from the measure specification model. This file contained all metadata related to the SMM Measure.

  • Name and description of the measure
  • Type of the measure
  • Unite of the measure
  • List of properties of the measure
  • List of references in case of a Derived Measure (inputs form others measures)
Element Cardinality Attribute Description
Measure 1 The Measure
name Name / Id of the Measure
type SMM Type of the measure : [DIRECT,COLLECTIVE,RACKING,GRADE,BINARY,COUNTING,ESCALED,RATIO]
unite Unit of the Measurement returned by the Measure
description 1 Description of the Measure
scopeProperties * A property user to configure the execution of the measure
name Name of the property
defaultValue Default value of the property
scopeProperties-description 1 Description of the property
references * References to inputs required by DErived Measures
measureRef Name of the required measure
number Default Number of instance of this input required
expirationDelay Filter old measurement
references-role 1 Role of the imput in current Measurement. This role allows to identify several instances of the same measure in a Derived Measure.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Measure name="RandomBinaryMeasure" type="BINARY" unite="Numeric">
    <description>A Test Measure calculating the sum of random numbers</description>
   <scopeProperties defaultValue="+" name="Operation">
        <description>Applied Operation</description>
    </scopeProperties>
    <references expirationDelay="60000" measureRef="RandomGenerator" number="1">
        <role>RandomNumber A</role>
    </references>
    <references expirationDelay="60000" measureRef="RandomGenerator" number="1">
        <role>RandomNumber B</role>
    </references>
</Measure>

Implement the measure

To implement the measure, you will have to complete the DirectMeasureImpl / DerivedMeasureImpl Java class generated from Modelio project.

Clone this wiki locally