Class Operation
An operation is a behavioral feature of a classifier that specifies the name, type, parameters, and constraints for invoking an associated behavior.
[XmlNamespace("http://www.omg.org/spec/MOF/20131001/cmof.xmi")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://www.omg.org/spec/MOF/20131001/cmof.xmi#//Operation")]
public class Operation : Feature, IOperation, IBehavioralFeature, IFeature, IRedefinableElement, INamespace, INamedElement, IElement, IObject, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
Operation
- Implements
- Inherited Members
Constructors
Operation()
Creates a new instance
public Operation()
Properties
BodyCondition
An optional Constraint on the result values of an invocation of this Operation.
[Browsable(false)]
[XmlElementName("bodyCondition")]
[XmlAttribute(false)]
[Containment]
public IConstraint BodyCondition { get; set; }
Property Value
Children
Gets the child model elements of this model element
public override IEnumerableExpression<IModelElement> Children { get; }
Property Value
Class
The class that owns the operation.
[Browsable(false)]
[XmlElementName("class")]
[XmlAttribute(true)]
[XmlOpposite("ownedOperation")]
public IClass Class { get; set; }
Property Value
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
Datatype
The DataType that owns this Operation.
[Browsable(false)]
[XmlElementName("datatype")]
[XmlAttribute(true)]
[XmlOpposite("ownedOperation")]
public IDataType Datatype { get; set; }
Property Value
ElementImport
References the ElementImports owned by the Namespace.
[Browsable(false)]
[XmlElementName("elementImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
public IOrderedSetExpression<IElementImport> ElementImport { get; }
Property Value
IsQuery
Specifies whether an execution of the BehavioralFeature leaves the state of the system unchanged (isQuery=true) or whether side effects may occur (isQuery=false).
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isQuery")]
[XmlAttribute(true)]
public bool IsQuery { get; set; }
Property Value
OwnedParameter
Specifies the ordered set of formal parameters of this BehavioralFeature.
[Browsable(false)]
[XmlElementName("ownedParameter")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IParameter> OwnedParameter { get; }
Property Value
PackageImport
References the PackageImports owned by the Namespace.
[Browsable(false)]
[XmlElementName("packageImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
public IOrderedSetExpression<IPackageImport> PackageImport { get; }
Property Value
Postcondition
An optional set of Constraints specifying the state of the system when the Operation is completed.
[Browsable(false)]
[XmlElementName("postcondition")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IConstraint> Postcondition { get; }
Property Value
Precondition
An optional set of Constraints on the state of the system when the Operation is invoked.
[Browsable(false)]
[XmlElementName("precondition")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IConstraint> Precondition { get; }
Property Value
RaisedException
References the Types representing exceptions that may be raised during an invocation of this feature.
[XmlElementName("raisedException")]
[XmlAttribute(true)]
public ISetExpression<IType> RaisedException { get; }
Property Value
RedefinedOperation
References the Operations that are redefined by this Operation.
[XmlElementName("redefinedOperation")]
[XmlAttribute(true)]
public ISetExpression<IOperation> RedefinedOperation { get; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Methods
At_most_one_return(object, object)
An operation can have at most one return parameter; i.e., an owned parameter with the direction set to 'return' self.ownedParameter->select(par | par.direction = #return)->size() <= 1
public bool At_most_one_return(object diagnostics, object context)
Parameters
diagnosticsobjectThe chain of diagnostics to which problems are to be appended.
contextobjectThe cache of context-specific information.
Returns
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)))
public ISetExpression<IPackageableElement> ExcludeCollisions(IEnumerable<IPackageableElement> imps)
Parameters
Returns
GetAttributeValue(string, int)
Resolves the given attribute name
protected override object GetAttributeValue(string attribute, int index)
Parameters
Returns
- object
The attribute value or null if it could not be found
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetCollectionForFeature(string)
Gets the Model element collection for the given feature
protected override IList GetCollectionForFeature(string feature)
Parameters
featurestringThe 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
containerobjectThe container object
Returns
- string
The name of the respective container reference
GetExpressionForAttribute(string)
Gets the property expression for the given attribute
protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)
Parameters
attributestringThe requested attribute in upper case
Returns
- INotifyExpression<object>
An incremental property expression
GetExpressionForReference(string)
Gets the property expression for the given reference
protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)
Parameters
referencestringThe requested reference in upper case
Returns
- INotifyExpression<IModelElement>
An incremental property expression
GetModelElementForReference(string, int)
Resolves the given URI to a child model element
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Returns
- IModelElement
The model element or null if it could not be found
GetNamesOfMember(INamedElement)
The query getNamesOfMember() takes importing into account. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. The query takes account of importing. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. result = if self.ownedMember ->includes(element) then Set{}->include(element.name) else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName()) else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element)) endif endif
public ISetExpression<string> GetNamesOfMember(INamedElement element)
Parameters
elementINamedElement
Returns
GetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative URI fragment for the given child model element
protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)
Parameters
elementIModelElementThe 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 owned members, and also excludes elements which would have the same name when imported. result = self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
public ISetExpression<IPackageableElement> ImportMembers(IEnumerable<IPackageableElement> imps)
Parameters
Returns
MembersAreDistinguishable()
The Boolean query membersAreDistinguishable() determines whether all of the namespace's members are distinguishable within it. result = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))
public bool MembersAreDistinguishable()
Returns
Members_distinguishable(object, object)
All the members of a Namespace are distinguishable within it. membersAreDistinguishable()
public bool Members_distinguishable(object diagnostics, object context)
Parameters
diagnosticsobjectThe chain of diagnostics to which problems are to be appended.
contextobjectThe cache of context-specific information.
Returns
OnAt_most_one_returnCalled(OperationCallEventArgs)
Raises the At_most_one_returnCalled event
protected virtual void OnAt_most_one_returnCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnAt_most_one_returnCalling(OperationCallEventArgs)
Raises the At_most_one_returnCalling event
protected virtual void OnAt_most_one_returnCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnBodyConditionChanged(ValueChangedEventArgs)
Raises the BodyConditionChanged event
protected virtual void OnBodyConditionChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnBodyConditionChanging(ValueChangedEventArgs)
Raises the BodyConditionChanging event
protected virtual void OnBodyConditionChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnClassChanged(ValueChangedEventArgs)
Raises the ClassChanged event
protected virtual void OnClassChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnClassChanging(ValueChangedEventArgs)
Raises the ClassChanging event
protected virtual void OnClassChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnDatatypeChanged(ValueChangedEventArgs)
Raises the DatatypeChanged event
protected virtual void OnDatatypeChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnDatatypeChanging(ValueChangedEventArgs)
Raises the DatatypeChanging event
protected virtual void OnDatatypeChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnExcludeCollisionsCalled(OperationCallEventArgs)
Raises the ExcludeCollisionsCalled event
protected virtual void OnExcludeCollisionsCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnExcludeCollisionsCalling(OperationCallEventArgs)
Raises the ExcludeCollisionsCalling event
protected virtual void OnExcludeCollisionsCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnGetNamesOfMemberCalled(OperationCallEventArgs)
Raises the GetNamesOfMemberCalled event
protected virtual void OnGetNamesOfMemberCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnGetNamesOfMemberCalling(OperationCallEventArgs)
Raises the GetNamesOfMemberCalling event
protected virtual void OnGetNamesOfMemberCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnImportMembersCalled(OperationCallEventArgs)
Raises the ImportMembersCalled event
protected virtual void OnImportMembersCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnImportMembersCalling(OperationCallEventArgs)
Raises the ImportMembersCalling event
protected virtual void OnImportMembersCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnIsQueryChanged(ValueChangedEventArgs)
Raises the IsQueryChanged event
protected virtual void OnIsQueryChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnIsQueryChanging(ValueChangedEventArgs)
Raises the IsQueryChanging event
protected virtual void OnIsQueryChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgsValueChangedEventArgsThe event data
OnMembersAreDistinguishableCalled(OperationCallEventArgs)
Raises the MembersAreDistinguishableCalled event
protected virtual void OnMembersAreDistinguishableCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnMembersAreDistinguishableCalling(OperationCallEventArgs)
Raises the MembersAreDistinguishableCalling event
protected virtual void OnMembersAreDistinguishableCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnMembers_distinguishableCalled(OperationCallEventArgs)
Raises the Members_distinguishableCalled event
protected virtual void OnMembers_distinguishableCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnMembers_distinguishableCalling(OperationCallEventArgs)
Raises the Members_distinguishableCalling event
protected virtual void OnMembers_distinguishableCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnOnly_body_for_queryCalled(OperationCallEventArgs)
Raises the Only_body_for_queryCalled event
protected virtual void OnOnly_body_for_queryCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnOnly_body_for_queryCalling(OperationCallEventArgs)
Raises the Only_body_for_queryCalling event
protected virtual void OnOnly_body_for_queryCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnReturnResultCalled(OperationCallEventArgs)
Raises the ReturnResultCalled event
protected virtual void OnReturnResultCalled(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
OnReturnResultCalling(OperationCallEventArgs)
Raises the ReturnResultCalling event
protected virtual void OnReturnResultCalling(OperationCallEventArgs eventArgs)
Parameters
eventArgsOperationCallEventArgsThe event data
Only_body_for_query(object, object)
A bodyCondition can only be specified for a query operation. bodyCondition->notEmpty() implies isQuery
public bool Only_body_for_query(object diagnostics, object context)
Parameters
diagnosticsobjectThe chain of diagnostics to which problems are to be appended.
contextobjectThe cache of context-specific information.
Returns
ReturnResult()
The query returnResult() returns the set containing the return parameter of the Operation if one exists, otherwise, it returns an empty set result = ownedParameter->select (par | par.direction = #return)
public ISetExpression<IParameter> ReturnResult()
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
Events
At_most_one_returnCalled
Gets fired after the operation at_most_one_return got called
public event EventHandler<OperationCallEventArgs> At_most_one_returnCalled
Event Type
At_most_one_returnCalling
Gets fired before the operation at_most_one_return gets called
public event EventHandler<OperationCallEventArgs> At_most_one_returnCalling
Event Type
BodyConditionChanged
Gets fired when the BodyCondition property changed its value
public event EventHandler<ValueChangedEventArgs> BodyConditionChanged
Event Type
BodyConditionChanging
Gets fired before the BodyCondition property changes its value
public event EventHandler<ValueChangedEventArgs> BodyConditionChanging
Event Type
ClassChanged
Gets fired when the Class property changed its value
public event EventHandler<ValueChangedEventArgs> ClassChanged
Event Type
ClassChanging
Gets fired before the Class property changes its value
public event EventHandler<ValueChangedEventArgs> ClassChanging
Event Type
DatatypeChanged
Gets fired when the Datatype property changed its value
public event EventHandler<ValueChangedEventArgs> DatatypeChanged
Event Type
DatatypeChanging
Gets fired before the Datatype property changes its value
public event EventHandler<ValueChangedEventArgs> DatatypeChanging
Event Type
ExcludeCollisionsCalled
Gets fired after the operation excludeCollisions got called
public event EventHandler<OperationCallEventArgs> ExcludeCollisionsCalled
Event Type
ExcludeCollisionsCalling
Gets fired before the operation excludeCollisions gets called
public event EventHandler<OperationCallEventArgs> ExcludeCollisionsCalling
Event Type
GetNamesOfMemberCalled
Gets fired after the operation getNamesOfMember got called
public event EventHandler<OperationCallEventArgs> GetNamesOfMemberCalled
Event Type
GetNamesOfMemberCalling
Gets fired before the operation getNamesOfMember gets called
public event EventHandler<OperationCallEventArgs> GetNamesOfMemberCalling
Event Type
ImportMembersCalled
Gets fired after the operation importMembers got called
public event EventHandler<OperationCallEventArgs> ImportMembersCalled
Event Type
ImportMembersCalling
Gets fired before the operation importMembers gets called
public event EventHandler<OperationCallEventArgs> ImportMembersCalling
Event Type
IsQueryChanged
Gets fired when the IsQuery property changed its value
public event EventHandler<ValueChangedEventArgs> IsQueryChanged
Event Type
IsQueryChanging
Gets fired before the IsQuery property changes its value
public event EventHandler<ValueChangedEventArgs> IsQueryChanging
Event Type
MembersAreDistinguishableCalled
Gets fired after the operation membersAreDistinguishable got called
public event EventHandler<OperationCallEventArgs> MembersAreDistinguishableCalled
Event Type
MembersAreDistinguishableCalling
Gets fired before the operation membersAreDistinguishable gets called
public event EventHandler<OperationCallEventArgs> MembersAreDistinguishableCalling
Event Type
Members_distinguishableCalled
Gets fired after the operation members_distinguishable got called
public event EventHandler<OperationCallEventArgs> Members_distinguishableCalled
Event Type
Members_distinguishableCalling
Gets fired before the operation members_distinguishable gets called
public event EventHandler<OperationCallEventArgs> Members_distinguishableCalling
Event Type
Only_body_for_queryCalled
Gets fired after the operation only_body_for_query got called
public event EventHandler<OperationCallEventArgs> Only_body_for_queryCalled
Event Type
Only_body_for_queryCalling
Gets fired before the operation only_body_for_query gets called
public event EventHandler<OperationCallEventArgs> Only_body_for_queryCalling
Event Type
ReturnResultCalled
Gets fired after the operation returnResult got called
public event EventHandler<OperationCallEventArgs> ReturnResultCalled
Event Type
ReturnResultCalling
Gets fired before the operation returnResult gets called
public event EventHandler<OperationCallEventArgs> ReturnResultCalling