feature-is-variable

Available in: KerML, SysML

This checks that variable features are owned by occurrences.

Specification

A Feature with is_variable = true must have an owning_type that directly or indirectly specializes the Class Occurrences::Occurrence from the Kernel Semantic Library.

Example

This is impossible to trigger in SysML because variable is computed automatically for relevant elements. Otherwise, in KerML:

var feature x; // error
feature a {
    var feature x; // errr
}
feature b {
    const feature x; // errr
}

Do not use var or const for features not owned by occurrences:

feature x; // ok
feature a { feature x; } // ok
feature b { feature x; } // ok

Otherwise, either add specialization to Occurrences::Occurrence, or change owning type to a class:

class a { var feature x; } // ok
feature b : Occurrences::Occurrence { const feature x; } // ok