SystemWeaver offers a Validity check tool which, when configured, enables users to verify, for example, that there are no errors present in a given model. The types of checks, and reason and solution messages are fully configurable, and can be configured to suit any specific meta model or validation need. The feature includes support for:

  • Multiple types of validity checks, e.g., error, warning, info, etc.
  • Configuring checks for any item type
  • Use of the Path Query Language
  • Item type inheritance

This article describes how to configure the Validity check feature.


Note: The checks are applied to item types, and handle navigation of sub-items.


Prerequisites


  1. Go to File > Configure the explorer
  2. On the Features tab, select Validity check.
  3. Click View example XML and copy the script as a starting point for your configuration. 
  4. Click Edit configuration and paste the configuration in the Edit XML window. 
  5. Modify the configuration to meet the needs of the use case(s). (See the explanation of available elements below.)
  6. Once you save your configuration, the Validity check option will be available to users.



Example Configuration

<ValidityCheckConfig>

 <ValidityTypes>
  <ValidityType validityTypeId="1" name="Error" guiImage="206"/>
  <ValidityType validityTypeId="2" name="Warning" guiImage="207"/>
  <ValidityType validityTypeId="3" name="Info" guiImage="246"/>
 </ValidityTypes>

 <Check name="Missing Id" select=".[@ASID = '']" validityTypeId="1" tag="security" itemType="SID1">
  <Reason description="The Id is missing."/>
  <Solution description="To resolve, add the Id to #{? Name + Version}."/>
 </Check>

 <Check name="Missing Safety Goal" select=".[not /PSID]" validityTypeId="2" tag="safety" itemType="SID2">
  <Reason description=" Safety goal is missing for #{Name}"/>
  <Solution description="Create a safety goal to mitigate the risk."/>
 </Check>

 <Check name="IsService" select="/PSID[@ASID= '']" validityTypeId="3" tag="AUTOSAR" itemType="SID3">
  <Reason description=" IsService is not set."/>
  <Solution description="To resolve, set IsService to True/False."/>
 </Check>

</ValidityCheckConfig>
XM

Explanation of the Configuration Elements

<ValidityCheckConfig> this element, along with its sub-elements, defines the validity check configuration.


<ValidityTypes> is a grouping tag which, together with the <ValidityType> tag, specifies the different types of checks, e.g., error, warning, info, etc.


<ValidityType> specifies the type of validity check. It has three required attributes. 

  • validityType defines the identifier for the validity type which can be referenced in the <Check> tag. Supported values are String values, which must be unique among the different validity types.
  • name defines the name of the validity type. The name displays in the pane as the option label, and in the Validity type column. Examples: Error, Warning, etc.
  • guiImage defines the icon for the validity type. Architect users can find the lists of available image icons, on the Checks tab in Configure the explorer. 


<Check> specifies the check to be applied for a specific item type. It has the following attributes. 

  • name is required, and defines the name of the check. The name displays in the Check name column. The supported value is a String value.
  • select is required, and defines the condition for the check. Supported values are Path queries.
  • validityTypeId is required, and references a validity type by id. The supported value is a validity type id defined within the configuration.  
  • tag is optional, and defines the category of the check, e.g., safety, security, legal, etc. The supported value is a String value. The tag value displays in the Tag column.
  • itemType is required, and defines the item type upon which the check will be applied. The supported value is an Item type SID. Note that this attribute handles inheritance. The item type name will display in the Item type name column.


<Reason> is a tag within Check, and specifies the reason for the check. It is added as a Reason message column. It has one attribute, description, which is required, and sets the description. Supported values are String values and/or path queries (using #{? ...}).


<Solution> is a tag within Check, and specifies the solution message for the check. It is added as a Solution message column. It has one attribute, description, which is required, and sets the description. Supported values are String values and/or path queries (using #{? ...})


Example Validity Check 

This example shows multiple items that are displayed as a result of three different "Warning" checks.