Touchstone
Reference

Auto-stereotyping rules

Every rule the plugin ships, its condition, and what it does not do.

This resource declares the three rules below; the engine that runs them — reading a committed transaction, applying the stereotype, driving the switch — is AutoStereotypeEngine in the shared Anvil library. What follows is the behaviour that engine guarantees for any resource's rules, not code that lives in this repository.

A rule runs when a transaction commits. It reads the whole batch of changes, so an element created, typed and re-owned in one user action is judged once, on the state the transaction leaves behind.

Attribute

A Property receives «Attribute» when both hold:

HalfSatisfied by
Ownerthe Property's owner carries «Concept»
Typeis a UML PrimitiveType, or is an Enumeration

Not accepted as a type: a plain Class, a plain DataType, a SysML ValueType, or no type at all. DataType is the supertype of both accepted datatype kinds and is excluded deliberately, so widening the rule stays a decision rather than a side effect of the type hierarchy. A «Concept» is not accepted either: a Concept-typed property is a Relation, below.

Association ends. An association end owned by a Concept and typed by another Concept is never an «Attribute», however the association is drawn: its type carries «Concept», not a PrimitiveType or an Enumeration. That case is a Relation, described below.

Switch: Auto-apply <<Attribute>> stereotype to Concept properties typed by a PrimitiveType or an Enumeration, in the Touchstone group.

Relation

A Property receives «Relation» when both hold:

HalfSatisfied by
Ownerthe Property's owner carries «Concept»
Typethe Property's type carries «Concept»

The property is the relation, directed from the owning Concept to the typing Concept. An association line is its notation: a directed association leaves one end on the source Concept, and that end qualifies; the far end, owned by the Association, does not. An association navigable both ways yields two Relations, one per direction. An association between two Concepts with no owned end yields none, because the modeller has not said which way the relation goes.

Switch: Auto-apply <<Relation>> stereotype to Concept properties typed by a Concept, in the Touchstone group.

StepAction

A CallBehaviorAction receives «StepAction» when both hold:

HalfSatisfied by
Ownerthe action's owner carries «Step»
Behaviorthe action's behavior carries «Step»

An action nested in a StructuredActivityNode is owned by that node rather than by the Activity, so its owner is not a Step and the rule declines. A process package does not use structured nodes.

Switch: Auto-apply <<StepAction>> stereotype to CallBehaviorActions calling Steps, in the Touchstone group.

What every rule does, and does not do

Adds only. No rule removes a stereotype. Removing «Concept» from a Class leaves «Attribute» and «Relation» on its properties, and removing «Step» from an Activity leaves «StepAction» on the actions calling it. Withdrawing a stereotype can destroy work done by hand, which is a different contract.

Idempotent. An element already carrying the stereotype — including through a specialisation of it — is left alone.

Skips deletions. An element the same transaction deletes is never stereotyped, even though a delete reports property changes on the way out.

Fails one element at a time. A read-only element, or one in an unloaded module, is reported in the log; the rest of the transaction still gets its stereotypes.

Joins the user's undo step. Stereotypes are applied from the committing session, so one user action remains one undo.

Never runs during undo or redo. The shared engine registers on addTransactionCommitListener, which excludes both.

When a rule reconsiders an element

An element enters a rule's scope when a transaction touches one of these:

RuleOn the usageOn the definition
Attributetype, UMLClass, INSTANCE_CREATEDappliedStereotype on a Class, sweeping its ownedAttribute and everything it types
Relationtype, UMLClass, INSTANCE_CREATEDappliedStereotype on a Class, sweeping its ownedAttribute and everything it types
StepActionbehavior, activity, INSTANCE_CREATEDappliedStereotype on an Activity, sweeping its node and every action calling it

The definition column is what lets a model drawn before the rules existed catch up: applying the defining stereotype reconsiders the usages, in both directions.

Ownership does not arrive as owner. A Property reports it as UMLClass and a CallBehaviorAction as activity; PropertyNames.OWNER fires for neither.

On this page