Table of Contents

Class State

Namespace
NMF.Interop.Uml
Assembly
NMF.UMLInterop.dll

A State models a situation during which some (usually implicit) invariant condition holds. <p>From package UML::StateMachines.</p>

[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//State")]
public class State : RedefinableElement, IState, IVertex, IRedefinableElement, INamespace, INamedElement, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
State
Implements
Derived
Inherited Members

Constructors

State()

Creates a new instance

public State()

Properties

Children

Gets the child model elements of this model element

public override IEnumerableExpression<IModelElement> Children { get; }

Property Value

IEnumerableExpression<IModelElement>

ClassInstance

Gets the Class model for this type

public static IClass ClassInstance { get; }

Property Value

IClass

Connection

The entry and exit connection points used in conjunction with this (submachine) State, i.e., as targets and sources, respectively, in the Region with the submachine State. A connection point reference references the corresponding definition of a connection point Pseudostate in the StateMachine referenced by the submachine State. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("connection")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("state")]
public IOrderedSetExpression<IConnectionPointReference> Connection { get; }

Property Value

IOrderedSetExpression<IConnectionPointReference>

ConnectionPoint

The entry and exit Pseudostates of a composite State. These can only be entry or exit Pseudostates, and they must have different names. They can only be defined for composite States. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("connectionPoint")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("state")]
public IOrderedSetExpression<IPseudostate> ConnectionPoint { get; }

Property Value

IOrderedSetExpression<IPseudostate>

Container

The Region that contains this Vertex. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("container")]
[XmlAttribute(true)]
[XmlOpposite("subvertex")]
public IRegion Container { get; set; }

Property Value

IRegion

DeferrableTrigger

A list of Triggers that are candidates to be retained by the StateMachine if they trigger no Transitions out of the State (not consumed). A deferred Trigger is retained until the StateMachine reaches a State configuration where it is no longer deferred. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("deferrableTrigger")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<ITrigger> DeferrableTrigger { get; }

Property Value

IOrderedSetExpression<ITrigger>

DoActivity

An optional Behavior that is executed while being in the State. The execution starts when this State is entered, and ceases either by itself when done, or when the State is exited, whichever comes first. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("doActivity")]
[XmlAttribute(false)]
[Containment]
public IBehavior DoActivity { get; set; }

Property Value

IBehavior

ElementImport

References the ElementImports owned by the Namespace. <p>From package UML::CommonStructure.</p>

[Browsable(false)]
[XmlElementName("elementImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
public IListExpression<IElementImport> ElementImport { get; }

Property Value

IListExpression<IElementImport>

Entry

An optional Behavior that is executed whenever this State is entered regardless of the Transition taken to reach the State. If defined, entry Behaviors are always executed to completion prior to any internal Behavior or Transitions performed within the State. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("entry")]
[XmlAttribute(false)]
[Containment]
public IBehavior Entry { get; set; }

Property Value

IBehavior

Exit

An optional Behavior that is executed whenever this State is exited regardless of which Transition was taken out of the State. If defined, exit Behaviors are always executed to completion only after all internal and transition Behaviors have completed execution. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("exit")]
[XmlAttribute(false)]
[Containment]
public IBehavior Exit { get; set; }

Property Value

IBehavior

PackageImport

References the PackageImports owned by the Namespace. <p>From package UML::CommonStructure.</p>

[Browsable(false)]
[XmlElementName("packageImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
public IListExpression<IPackageImport> PackageImport { get; }

Property Value

IListExpression<IPackageImport>

RedefinedState

The State of which this State is a redefinition. <p>From package UML::StateMachines.</p>

[XmlElementName("redefinedState")]
[XmlAttribute(true)]
public IState RedefinedState { get; set; }

Property Value

IState

ReferencedElements

Gets the referenced model elements of this model element

public override IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

Region

The Regions owned directly by the State. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("region")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("state")]
public IOrderedSetExpression<IRegion> Region { get; }

Property Value

IOrderedSetExpression<IRegion>

StateInvariant

Specifies conditions that are always true when this State is the current State. In ProtocolStateMachines state invariants are additional conditions to the preconditions of the outgoing Transitions, and to the postcondition of the incoming Transitions. <p>From package UML::StateMachines.</p>

[Browsable(false)]
[XmlElementName("stateInvariant")]
[XmlAttribute(false)]
[Containment]
public IConstraint StateInvariant { get; set; }

Property Value

IConstraint

Submachine

The StateMachine that is to be inserted in place of the (submachine) State. <p>From package UML::StateMachines.</p>

[XmlElementName("submachine")]
[XmlAttribute(true)]
[XmlOpposite("submachineState")]
public IStateMachine Submachine { get; set; }

Property Value

IStateMachine

Methods

Cannot_import_ownedMembers(object, object)

A Namespace cannot have an ElementImport to one of its ownedMembers. elementImport.importedElement.oclAsType(Element)->excludesAll(ownedMember)

public bool Cannot_import_ownedMembers(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

Cannot_import_self(object, object)

A Namespace cannot have a PackageImport to itself. packageImport.importedPackage.oclAsType(Namespace)->excludes(self)

public bool Cannot_import_self(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

Composite_states(object, object)

Only composite States can have entry or exit Pseudostates defined. connectionPoint->notEmpty() implies isComposite

public bool Composite_states(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

ContainingStateMachine()

The operation containingStateMachine() returns the StateMachine in which this Vertex is defined. result = (if container <> null then -- the container is a region container.containingStateMachine() else if (self.oclIsKindOf(Pseudostate)) and ((self.oclAsType(Pseudostate).kind = PseudostateKind::entryPoint) or (self.oclAsType(Pseudostate).kind = PseudostateKind::exitPoint)) then self.oclAsType(Pseudostate).stateMachine else if (self.oclIsKindOf(ConnectionPointReference)) then self.oclAsType(ConnectionPointReference).state.containingStateMachine() -- no other valid cases possible else null endif endif endif ) <p>From package UML::StateMachines.</p>

public IStateMachine ContainingStateMachine()

Returns

IStateMachine

CreateElementImport(IPackageableElement, VisibilityKind)

Creates an import of the specified element into this namespace with the specified visibility.

public IElementImport CreateElementImport(IPackageableElement element, VisibilityKind visibility)

Parameters

element IPackageableElement

The element to import.

visibility VisibilityKind

The visibility for the new element import.

Returns

IElementImport

CreatePackageImport(IPackage, VisibilityKind)

Creates an import of the specified package into this namespace with the specified visibility.

public IPackageImport CreatePackageImport(IPackage package_, VisibilityKind visibility)

Parameters

package_ IPackage

The package to import.

visibility VisibilityKind

The visibility for the new package import.

Returns

IPackageImport

Destinations_or_sources_of_transitions(object, object)

The connection point references used as destinations/sources of Transitions associated with a submachine State must be defined as entry/exit points in the submachine StateMachine. self.isSubmachineState implies (self.connection->forAll (cp | cp.entry->forAll (ps | ps.stateMachine = self.submachine) and cp.exit->forAll (ps | ps.stateMachine = self.submachine)))

public bool Destinations_or_sources_of_transitions(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

Entry_or_exit(object, object)

Only entry or exit Pseudostates can serve as connection points. connectionPoint->forAll(kind = PseudostateKind::entryPoint or kind = PseudostateKind::exitPoint)

public bool Entry_or_exit(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

ExcludeCollisions(IEnumerable<IPackageableElement>)

The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this Namespace. result = (imps->reject(imp1 | imps->exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))) <p>From package UML::CommonStructure.</p>

public ISetExpression<IPackageableElement> ExcludeCollisions(IEnumerable<IPackageableElement> imps)

Parameters

imps IEnumerable<IPackageableElement>

Returns

ISetExpression<IPackageableElement>

GetClass()

Gets the Class for this model element

public override IClass GetClass()

Returns

IClass

GetCollectionForFeature(string)

Gets the Model element collection for the given feature

protected override IList GetCollectionForFeature(string feature)

Parameters

feature string

The requested feature

Returns

IList

A non-generic list of elements

GetCompositionName(object)

Gets the property name for the given container

protected override string GetCompositionName(object container)

Parameters

container object

The container object

Returns

string

The name of the respective container reference

GetExpressionForReference(string)

Gets the property expression for the given reference

protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)

Parameters

reference string

The requested reference in upper case

Returns

INotifyExpression<IModelElement>

An incremental property expression

GetImportedElements()

Retrieves the elements imported by this namespace.

public ISetExpression<IPackageableElement> GetImportedElements()

Returns

ISetExpression<IPackageableElement>

GetImportedMembers()

The importedMember property is derived as the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. result = (self.importMembers(elementImport.importedElement->asSet()->union(packageImport.importedPackage->collect(p | p.visibleMembers()))->asSet())) <p>From package UML::CommonStructure.</p>

public ISetExpression<IPackageableElement> GetImportedMembers()

Returns

ISetExpression<IPackageableElement>

GetImportedPackages()

Retrieves the packages imported by this namespace.

public ISetExpression<IPackage> GetImportedPackages()

Returns

ISetExpression<IPackage>

GetIncomings()

Derivation for Vertex::/incoming. result = (Transition.allInstances()->select(target=self)) <p>From package UML::StateMachines.</p>

public ISetExpression<ITransition> GetIncomings()

Returns

ISetExpression<ITransition>

GetModelElementForReference(string, int)

Resolves the given URI to a child model element

protected override IModelElement GetModelElementForReference(string reference, int index)

Parameters

reference string

The requested reference name

index int

The index of this reference

Returns

IModelElement

The model element or null if it could not be found

GetNamesOfMember(INamedElement)

The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace, taking importing into account. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. result = (if self.ownedMember ->includes(element) then Set{element.name} else let elementImports : Set(ElementImport) = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName())->asSet() else self.packageImport->select(pi | pi.importedPackage.visibleMembers().oclAsType(NamedElement)->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element))->asSet() endif endif) <p>From package UML::CommonStructure.</p>

public ISetExpression<string> GetNamesOfMember(INamedElement element)

Parameters

element INamedElement

Returns

ISetExpression<string>

GetOutgoings()

Derivation for Vertex::/outgoing result = (Transition.allInstances()->select(source=self)) <p>From package UML::StateMachines.</p>

public ISetExpression<ITransition> GetOutgoings()

Returns

ISetExpression<ITransition>

GetOwnedMembers()

public ISetExpression<INamedElement> GetOwnedMembers()

Returns

ISetExpression<INamedElement>

GetRelativePathForNonIdentifiedChild(IModelElement)

Gets the relative URI fragment for the given child model element

protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)

Parameters

element IModelElement

The element that should be looked for

Returns

string

A fragment of the relative URI

ImportMembers(IEnumerable<IPackageableElement>)

The query importMembers() defines which of a set of PackageableElements are actually imported into the Namespace. This excludes hidden ones, i.e., those which have names that conflict with names of ownedMembers, and it also excludes PackageableElements that would have the indistinguishable names when imported. result = (self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | imp.isDistinguishableFrom(mem, self)))) <p>From package UML::CommonStructure.</p>

public ISetExpression<IPackageableElement> ImportMembers(IEnumerable<IPackageableElement> imps)

Parameters

imps IEnumerable<IPackageableElement>

Returns

ISetExpression<IPackageableElement>

IsContainedInRegion(IRegion)

This utility query returns true if the Vertex is contained in the Region r (input argument). result = (if (container = r) then true else if (r.state->isEmpty()) then false else container.state.isContainedInRegion(r) endif endif) <p>From package UML::StateMachines.</p>

public bool IsContainedInRegion(IRegion r)

Parameters

r IRegion

Returns

bool

IsContainedInState(IState)

This utility operation returns true if the Vertex is contained in the State s (input argument). result = (if not s.isComposite() or container->isEmpty() then false else if container.state = s then true else container.state.isContainedInState(s) endif endif) <p>From package UML::StateMachines.</p>

public bool IsContainedInState(IState s)

Parameters

s IState

Returns

bool

MembersAreDistinguishable()

The Boolean query membersAreDistinguishable() determines whether all of the Namespace's members are distinguishable within it. result = (member->forAll( memb | member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))) <p>From package UML::CommonStructure.</p>

public bool MembersAreDistinguishable()

Returns

bool

Members_distinguishable(object, object)

All the members of a Namespace are distinguishable within it. membersAreDistinguishable()

public bool Members_distinguishable(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

OnParentChanged(IModelElement, IModelElement)

Gets called when the parent model element of the current model element changes

protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)

Parameters

newParent IModelElement

The new parent model element

oldParent IModelElement

The old parent model element

OnParentChanging(IModelElement, IModelElement)

Gets called when the parent model element of the current model element is about to change

protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)

Parameters

newParent IModelElement

The new parent model element

oldParent IModelElement

The old parent model element

SetFeature(string, object)

Sets a value to the given feature

protected override void SetFeature(string feature, object value)

Parameters

feature string

The requested feature

value object

The value that should be set to that feature

Submachine_or_regions(object, object)

A State is not allowed to have both a submachine and Regions. isComposite implies not isSubmachineState

public bool Submachine_or_regions(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

Submachine_states(object, object)

Only submachine States can have connection point references. isSubmachineState implies connection->notEmpty( )

public bool Submachine_states(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool