Ensuring consistency of data is quite critical, and although SystemWeaver uses a strong meta model to avoid inconsistencies, there are still possibilities that this can happen. For example, a receive port may not have a send signal, or you might want to check that items being used are coming from a specific sub-set of items. The SystemWeaver configurable views, i.e., Report, Grid and Chart, can be used to perform consistency checks.  This article presents some generic and easy-to-follow grid examples for these checks. 

There are several advantages of using Grid to perform consistency checks:

  • Interactivity offers an easy way to highlight the corresponding object with consistency issue
  • Grouping mechanism helps to structure the inconsistency cases into groups
  • Editability offers an easy way to fix the inconsistency cases within the same view
  • The grid can be exported to Excel if needed

In this article we will introduce a new way of building consistency checks using <RowObject select=".."> and <StringValueColumn/> which are available in SystemWeaver v R34 or later. The use of RowObject select=".." together with StringValueColumn results in a significant performance improvement for grid generation, compared with using TextColumn with pathQuery condition inside. Also, the size of the definition becomes comparatively smaller and easier to follow.

Tip: Release R39 and later offer a built-in, fully-configurable Validity check feature! 

Design Architecture Example

In a design architecture, the following checks will be performed. The grid will list of all the items that violate the checks.

  1. Software component without send ports
  2. Software component without receive ports
  3. Send signal without receiver
  4. Received signal without sender

One can also add more checks for example:

  1. Duplicate ports (checks if the name is unique in the whole system)
  2. Signal naming rules (checks if the name follows the naming rule which is [A-Z][A-Za-z0-9]{0,41})
  3. Empty port description
  4. Signal not connected to data type

Please note the above checks are just simple examples, and more complex checks can be added. Also, one can use Systemweaver functions for more complex checks (examples: Defining Custom Functions Using SystemWeaver Path Expressions)

Example Meta Model

Example Data

Example Configuration

    <!--The optional groupBy attribute sets what should be grouped by default.-->
        <Grouping groupBy="2,3"/>

        <ItemNameColumn width="400" icon="true"/>  
        <ItemTypeColumn width="400" caption="Item Type"/> 
        <StringValueColumn width="400" caption="Consistency Checks" objectName="consistencyChecks"/>  

    <!--Variables to collect inconsistency cases--> 

    <!--Send ports-->
    <Variable name="SendPorts" as="Items" select="/ITFC/ARPP"/>
    <!--Receive Ports-->
    <Variable name="ReceivePorts" as="Items" select="/ITFC/ARRP"/>
    <!--Check 1: Software component without send ports--> 
    <Variable name="LCWoSendPorts" as="Items" select="/ITFC[not /ARPP]"/>
    <!--Check 2: Software component without receive ports-->
    <Variable name="LCWoReceivePorts" as="Items" select="/ITFC[not /ARRP]"/>
    <!--Check 3: Send signal without receiver-->
    <Variable name="SendPortsWoreceiver" as="Items" select="$SendPorts[not . in $ReceivePorts]"/>
    <!--Check 4: Received signal without sender-->
    <Variable name="ReceiverPortsWoSender" as="Items" select="$ReceivePorts[not . in $SendPorts]"/>

    <ForEach select="$LCWoSendPorts">
        <RowObject name="consistencyChecks" select=" 'Logical component without Send Ports'">   
    <ForEach select="$LCWoReceivePorts union $LCWoSendPorts ">
        <RowObject name="consistencyChecks" select=" 'Logical component without Receive Ports'">   
    <ForEach select="$SendPortsWoreceiver">
        <RowObject name="consistencyChecks" select="'Send ports without receiver'">   
    <ForEach select="$ReceiverPortsWoSender">
        <RowObject name="consistencyChecks" select="'Receiver ports without Sender'">   

Example Result - with no Grouping

One can apply a grouping mechanism to group the consistency check based on item name, item type, consistency checks or a combination of two or more things, e.g., grouping based on item type and consistency check.

Example Result - with Grouping on Column Number 2 and 3

    <!--The optional groupBy attribute sets what should be grouped by default.-->
        <Grouping groupBy="2,3"/>

Example Result - with Grouping on Column Number 1