Rules Import/Export#

Architecture Rules can be imported and exported from Lattix, via the menu File-->Import Rules... and File-->Export Rules... respectively. The exported file is in XML format and defaults to a .rul extension.

The .rul file can also be created by hand. You will need to know the full names of the partiton paths as generated by Lattix.

The rules file is used to import rules into Lattix. The rules are added to the project and can be viewed in the Rules tab on the right side of Lattix Architect. (Previously existing rules are not removed).

The exported file looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<lattix version="9.0">
 <project_rules>
  <partition name="$root">
   <rule name="generic">
    <access verb="can-use" nametype="partition" name="$root"/>
    <access verb="can-use" nametype="language" name="undefined.**"/>
    <access verb="can-use" nametype="language" name="multidef.**"/>
    <access verb="can-use" nametype="language" name="unresolved.**"/>
   </rule>
  </partition>
  <partition name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.*">
   <rule name="rule">
    <access verb="cannot-use" nametype="partition" name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.util"/>
    <access verb="cannot-use" nametype="partition" name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.driver"/>
    <access verb="cannot-use" nametype="partition" name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.hal"/>
    <access verb="cannot-use" nametype="partition" name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.scheduler"/>
    <access verb="cannot-use" nametype="partition" name="$root/library.xgpl_src/library.xgpl_src.IsoAgLib/library.xgpl_src.IsoAgLib.comm"/>
   </rule>
  </partition>
  <tag name="MyTag">
    <rule name="rule">
     <access verb="cannot-use" nametype="classification" name="core" description=""/>
    </rule>
  </tag>
 </project_rules>
</lattix>

As shown in the file, rules can be set on partitions (subsystems) and on tags.

<partition> element#

The <partition> element will refer to an already existing partition in the Lattix model via the name attribute. The name must be the full path to the partition (subsystem). The rules specified within the <partition> element are intended to only apply to the named partition and its children.

<tag> element#

The <tag> element will refer to an already existing tag in the Lattix model. The rules specified within the <tag> element are intended to only apply to the named tag.

<rule> element#

The <rule> element is simply a container to hold the <access> elements. Each <rule> element can have multiple <access> elements.

<access> element#

The <access> element defines the actual rule for the partition or tag it is contained in.

The order of the <access> elements is important.

The <access> element has the following attributes: verb, nametype, name, and description as described below.

Attributes of <access> element#

Attribute

Possible Values

verb

can-use cannot-use must-use

nametype

partition language classification

name

The meaning depends on value of nametype (See table below)

description

Text description of the rule

Meaning of name attribute, based on nametype#

nametype

Meaning of name

partition

The full path of a partition.

language

Language construct, for instance, in java it could be java.util.**.

classification

The name of a tag