Software Disclaimer

Class UML 2.5::Gate

Description:

A Gate is a MessageEnd which serves as a connection point for relating a Message which has a MessageEnd (sendEvent / receiveEvent) outside an InteractionFragment with another Message which has a MessageEnd (receiveEvent / sendEvent) inside that InteractionFragment.

Direct Superclasses: MessageEnd

Direct Subclasses:

Class Precedence List: Gate, MessageEnd, NamedElement, Element

Properties:

message : Message (0 1); -- source MessageEnd
clientDependency : Dependency (0 *); -- source NamedElement
name : String (0 1); -- source NamedElement
nameExpression : StringExpression (0 1); -- source NamedElement
namespace : Namespace (0 1); -- source NamedElement
qualifiedName : String (0 1); -- source NamedElement

A name that allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing Namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself.
{readonly, derived}

visibility : VisibilityKind (0 1); -- source NamedElement
ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

Constraints:

No additional constraints.

Operations:

Signature: matches(gateToMatch : Gate; ) : Boolean;
Description: This query returns true if the name of this Gate matches the name of the in parameter Gate, and the messages for the two Gates correspond. The Message for one Gate (say A) corresponds to the Message for another Gate (say B) if (A and B have the same name value) and (if A is a sendEvent then B is a receiveEvent) and (if A is a receiveEvent then B is a sendEvent) and (A and B have the same messageSort value) and (A and B have the same signature value).
Expression: result = (self.getName() = gateToMatch.getName() and self.message.messageSort = gateToMatch.message.messageSort and self.message.name = gateToMatch.message.name and self.message.sendEvent->includes(self) implies gateToMatch.message.receiveEvent->includes(gateToMatch) and self.message.receiveEvent->includes(self) implies gateToMatch.message.sendEvent->includes(gateToMatch) and self.message.signature = gateToMatch.message.signature)

Signature: isOutsideCF() : Boolean;
Description: This query returns true if this Gate is attached to the boundary of a CombinedFragment, and its other end (if present) is outside of the same CombinedFragment.
Expression: result = (self.oppositeEnd()-> notEmpty() and combinedFragment->notEmpty() implies let oppEnd : MessageEnd = self.oppositeEnd()->asOrderedSet()->first() in if oppEnd.oclIsKindOf(MessageOccurrenceSpecification) then let oppMOS : MessageOccurrenceSpecification = oppEnd.oclAsType(MessageOccurrenceSpecification) in self.combinedFragment.enclosingInteraction.oclAsType(InteractionFragment)->asSet()-> union(self.combinedFragment.enclosingOperand.oclAsType(InteractionFragment)->asSet()) = oppMOS.enclosingInteraction.oclAsType(InteractionFragment)->asSet()-> union(oppMOS.enclosingOperand.oclAsType(InteractionFragment)->asSet()) else let oppGate : Gate = oppEnd.oclAsType(Gate) in self.combinedFragment.enclosingInteraction.oclAsType(InteractionFragment)->asSet()-> union(self.combinedFragment.enclosingOperand.oclAsType(InteractionFragment)->asSet()) = oppGate.combinedFragment.enclosingInteraction.oclAsType(InteractionFragment)->asSet()-> union(oppGate.combinedFragment.enclosingOperand.oclAsType(InteractionFragment)->asSet()) endif)

Signature: isInsideCF() : Boolean;
Description: This query returns true if this Gate is attached to the boundary of a CombinedFragment, and its other end (if present) is inside of an InteractionOperator of the same CombinedFragment.
Expression: result = (self.oppositeEnd()-> notEmpty() and combinedFragment->notEmpty() implies let oppEnd : MessageEnd = self.oppositeEnd()->asOrderedSet()->first() in if oppEnd.oclIsKindOf(MessageOccurrenceSpecification) then let oppMOS : MessageOccurrenceSpecification = oppEnd.oclAsType(MessageOccurrenceSpecification) in combinedFragment = oppMOS.enclosingOperand.combinedFragment else let oppGate : Gate = oppEnd.oclAsType(Gate) in combinedFragment = oppGate.combinedFragment.enclosingOperand.combinedFragment endif)

Signature: isFormal() : Boolean;
Description: This query returns true if this Gate is a formalGate of an Interaction.
Expression: result = (interaction->notEmpty())

Signature: isDistinguishableFrom(n : NamedElement; ns : Namespace; ) : Boolean;
Description: The query isDistinguishableFrom() specifies that two Gates may coexist in the same Namespace, without an explicit name property. The association end formalGate subsets ownedElement, and since the Gate name attribute is optional, it is allowed to have two formal gates without an explicit name, but having derived names which are distinct.
Expression: result = (true)

Signature: isActual() : Boolean;
Description: This query returns true value if this Gate is an actualGate of an InteractionUse.
Expression: result = (interactionUse->notEmpty())

Signature: getOperand() : InteractionOperand;
Description: If the Gate is an inside Combined Fragment Gate, this operation returns the InteractionOperand that the opposite end of this Gate is included within.
Expression: result = (if isInsideCF() then let oppEnd : MessageEnd = self.oppositeEnd()->asOrderedSet()->first() in if oppEnd.oclIsKindOf(MessageOccurrenceSpecification) then let oppMOS : MessageOccurrenceSpecification = oppEnd.oclAsType(MessageOccurrenceSpecification) in oppMOS.enclosingOperand->asOrderedSet()->first() else let oppGate : Gate = oppEnd.oclAsType(Gate) in oppGate.combinedFragment.enclosingOperand->asOrderedSet()->first() endif else null endif)

Signature: getName() : String;
Description: This query returns the name of the gate, either the explicit name (.name) or the constructed name ('out_" or 'in_' concatenated in front of .message.name) if the explicit name is not present.
Expression: result = (if name->notEmpty() then name->asOrderedSet()->first() else if isActual() or isOutsideCF() then if isSend() then 'out_'.concat(self.message.name->asOrderedSet()->first()) else 'in_'.concat(self.message.name->asOrderedSet()->first()) endif else if isSend() then 'in_'.concat(self.message.name->asOrderedSet()->first()) else 'out_'.concat(self.message.name->asOrderedSet()->first()) endif endif endif)



Send questions or comments to [email protected].