Export Filter
Export Mapping with Type Filtering
When creating export mapping rules, you can use the special element type keywords
#Any and #None to either match all EA element types or explicitly exclude
elements from export. You can also define generic mapping rules for a
type/stereotype combination.
How Type Filtering Works
For each mapping rule, you can define conditions that determine which types of
elements are exported. Instead of mapping an element only by a specific
_objectType / _stereotype combination, you can create generic type mappings
and selectively include stereotypes. This is useful when a stereotype is applied
to multiple EA element types.
In addition, specific EA element types can be explicitly excluded from export.
For example, you might configure a rule to export all EA elements with the
stereotype LemonTree Connect::suspected. Since the stereotype can be applied
to multiple element types, you would need separate mapping rules for
each base type.
However by using the keyword #Any as type together with a _stereotype mapping, you can define
a single generic mapping rule that exports all matching elements regardless of
their EA type.
Do not use #Any without a stereotype mapping
The keyword #Any matches all elements found in an export package in EA. This includes diagrams, properties and parameters.
If you do not combine this type match with a stereotype, the export writes
all elements within the package to Polarion.
Always combine #Any with a _stereotype mapping to limit the export scope.
Tip
Use #Any when the same stereotype has been applied to multiple EA element
types and you want a single export rule instead of maintaining separate
mappings for each element type.
Example Type Filtering
The base matching rules for exporting SysML Blocks and Signals from EA to a set in Polarion are:
<matchingRule>
<externalProperty name='_objectType' value='block' />
<myumlProperty name='_objectType' value='Class' />
<myumlProperty name='_stereotype' value='SysML1.4::block' />
</matchingRule>
<matchingRule>
<externalProperty name='_objectType' value='block' />
<myumlProperty name='_objectType' value='Signal' />
</matchingRule>
If you have a stereotype that applies to all your blocks (such as
MyStereotype::MyBlocks), you would normally need to add the stereotype rule to every
matching rule. With the keyword #Any, you can combine them into a single rule:
<matchingRule>
<externalProperty name='_objectType' value='block' />
<myumlProperty name='_objectType' value='#Any' />
<myumlProperty name='_stereotype' value='MyStereotype::MyBlocks' />
</matchingRule>
To ignore all elements with this stereotype regardless of element type, use the
keyword #None for the Polarion type:
<matchingRule>
<externalProperty name='_objectType' value='#None' />
<myumlProperty name='_objectType' value='#Any' />
<myumlProperty name='_stereotype' value='MyStereotype::MyBlocks' />
</matchingRule>
Note
The #None keyword must be used on the Polarion side via externalProperty. It cannot be used as a replacement for the EA _objectType.
Export Filter Keywords
| Keyword | Meaning | Result |
|---|---|---|
#Any |
Matches all EA types. It has to be used together with a _stereotype mapping to filter by stereotype rather than EA type. |
All items with the additionally given stereotype are exported, regardless of their EA type. |
#None |
Explicitly excludes matching elements from export. It must be used for the Polarion (externalProperty) type. |
Elements matching the configured stereotype are excluded from export and are not exported. |
Examples
Export all elements that have a custom stereotype
In EA, the following elements are given:
Element001: type =Class, stereotype =StakeholderElement002: type =Interface, stereotype =StakeholderElement003: type =ClassElement004: type =Interface
The following mapping rule is used:
<matchingRule>
<externalProperty name='_objectType' value='block' />
<myumlProperty name='_objectType' value='#Any' />
<myumlProperty name='_stereotype' value='Stakeholder' />
</matchingRule>
Result
Element001 and Element002 are exported to Polarion with Polarion type block because they match the
configured _stereotype Stakeholder mapping.
Ignore specific elements, regardless of their type
In EA, the following elements are given:
Element001: type =ClassElement002: type =InterfaceElement003: type =ActivityElement004: type =Class, stereotype =ignoreElement005: type =Interface, stereotype =ignore
The following mapping rule is used:
<matchingRule>
<externalProperty name='_objectType' value='#None' />
<myumlProperty name='_objectType' value='#Any' />
<myumlProperty name='_stereotype' value='ignore' />
</matchingRule>
.
.
.
<matchingRule>
<externalProperty name='_objectType' value='EAElement' />
<myumlProperty name='_objectType' value='Class' />
</matchingRule>
.
.
.
<matchingRule>
<externalProperty name='_objectType' value='EAElement' />
<myumlProperty name='_objectType' value='Interface' />
</matchingRule>
Result
Element001, Element002 are exported to Polarion.
Element003 is not exported as it is not mapped.
Element004 and Element005 are excluded because they match the
ignore stereotype and are mapped to #None.
Note
Pay attention to the order here, the ignore rule has to trigger before the catch all export rules for Class and Interface!