Class Operation
An Operation is a BehavioralFeature of a Classifier that specifies the name, type, parameters, and constraints for invoking an associated Behavior. An Operation may invoke both the execution of method behaviors as well as other behavioral responses. Operation specializes TemplateableElement in order to support specification of template operations and bound operations. Operation specializes ParameterableElement to specify that an operation can be exposed as a formal template parameter, and provided as an actual parameter in a binding of a template. <p>From package UML::Classification.</p>
[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//Operation")]
public class Operation : Feature, IOperation, ITemplateableElement, IParameterableElement, IBehavioralFeature, IFeature, IRedefinableElement, INamespace, INamedElement, IElement, IEModelElement, 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. <p>From package UML::Classification.</p>
[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 this operation, if any. <p>From package UML::Classification.</p>
[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
Concurrency
Specifies the semantics of concurrent calls to the same passive instance (i.e., an instance originating from a Class with isActive being false). Active instances control access to their own BehavioralFeatures. <p>From package UML::Classification.</p>
[XmlElementName("concurrency")]
[XmlAttribute(true)]
public CallConcurrencyKind Concurrency { get; set; }
Property Value
Datatype
The DataType that owns this Operation, if any. <p>From package UML::Classification.</p>
[Browsable(false)]
[XmlElementName("datatype")]
[XmlAttribute(true)]
[XmlOpposite("ownedOperation")]
public IDataType Datatype { get; set; }
Property Value
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
Interface
The Interface that owns this Operation, if any. <p>From package UML::Classification.</p>
[Browsable(false)]
[XmlElementName("interface")]
[XmlAttribute(true)]
[XmlOpposite("ownedOperation")]
public IInterface Interface { get; set; }
Property Value
IsAbstract
If true, then the BehavioralFeature does not have an implementation, and one must be supplied by a more specific Classifier. If false, the BehavioralFeature must have an implementation in the Classifier or one must be inherited. <p>From package UML::Classification.</p>
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isAbstract")]
[XmlAttribute(true)]
public bool IsAbstract { get; set; }
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). <p>From package UML::Classification.</p>
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isQuery")]
[XmlAttribute(true)]
public bool IsQuery { get; set; }
Property Value
Method
A Behavior that implements the BehavioralFeature. There may be at most one Behavior for a particular pairing of a Classifier (as owner of the Behavior) and a BehavioralFeature (as specification of the Behavior). <p>From package UML::Classification.</p>
[XmlElementName("method")]
[XmlAttribute(true)]
[XmlOpposite("specification")]
public ISetExpression<IBehavior> Method { get; }
Property Value
OwnedParameter
The ordered set of formal Parameters of this BehavioralFeature. <p>From package UML::Classification.</p>
[Browsable(false)]
[XmlElementName("ownedParameter")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IParameter> OwnedParameter { get; }
Property Value
OwnedParameterSet
The ParameterSets owned by this BehavioralFeature. <p>From package UML::Classification.</p>
[Browsable(false)]
[XmlElementName("ownedParameterSet")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IParameterSet> OwnedParameterSet { get; }
Property Value
OwnedTemplateSignature
The optional TemplateSignature specifying the formal TemplateParameters for this TemplateableElement. If a TemplateableElement has a TemplateSignature, then it is a template. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("ownedTemplateSignature")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("template")]
public ITemplateSignature OwnedTemplateSignature { get; set; }
Property Value
OwningTemplateParameter
The formal TemplateParameter that owns this ParameterableElement. <p>From package UML::CommonStructure.</p>
[XmlElementName("owningTemplateParameter")]
[XmlAttribute(true)]
[XmlOpposite("ownedParameteredElement")]
public ITemplateParameter OwningTemplateParameter { get; set; }
Property Value
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
Postcondition
An optional set of Constraints specifying the state of the system when the Operation is completed. <p>From package UML::Classification.</p>
[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. <p>From package UML::Classification.</p>
[Browsable(false)]
[XmlElementName("precondition")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IConstraint> Precondition { get; }
Property Value
RaisedException
The Types representing exceptions that may be raised during an invocation of this BehavioralFeature. <p>From package UML::Classification.</p>
[XmlElementName("raisedException")]
[XmlAttribute(true)]
public ISetExpression<IType> RaisedException { get; }
Property Value
RedefinedOperation
The Operations that are redefined by this Operation. <p>From package UML::Classification.</p>
[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
TemplateBinding
The optional TemplateBindings from this TemplateableElement to one or more templates. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("templateBinding")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("boundElement")]
public IOrderedSetExpression<ITemplateBinding> TemplateBinding { get; }
Property Value
TemplateParameter
The TemplateParameter that exposes this ParameterableElement as a formal parameter. <p>From package UML::CommonStructure.</p>
[XmlElementName("templateParameter")]
[XmlAttribute(true)]
[XmlOpposite("parameteredElement")]
public ITemplateParameter TemplateParameter { get; set; }
Property Value
Methods
Abstract_no_method(object, object)
When isAbstract is true there are no methods. isAbstract implies method->isEmpty()
public bool Abstract_no_method(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
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(direction = ParameterDirectionKind::return)->size() <= 1
public bool At_most_one_return(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
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
IPackageableElementThe element to import.
visibility
VisibilityKindThe visibility for the new element import.
Returns
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_
IPackageThe package to import.
visibility
VisibilityKindThe visibility for the new package import.
Returns
CreateReturnResult(string, IType)
Creates a return result parameter with the specified name and type.
public IParameter CreateReturnResult(string name, IType type)
Parameters
name
stringThe name for the new return result, or null.
type
ITypeThe type for the new return result, or null.
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)))) <p>From package UML::CommonStructure.</p>
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
feature
stringThe 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
objectThe 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
attribute
stringThe 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
reference
stringThe 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
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
GetImportedPackages()
Retrieves the packages imported by this namespace.
public ISetExpression<IPackage> GetImportedPackages()
Returns
GetLower()
If this operation has a return parameter, lower equals the value of lower for that parameter. Otherwise lower has no value. result = (if returnResult()->notEmpty() then returnResult()->any(true).lower else null endif) <p>From package UML::Classification.</p>
public int GetLower()
Returns
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() 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
GetOwnedMembers()
public ISetExpression<INamedElement> GetOwnedMembers()
Returns
GetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative URI fragment for the given child model element
protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)
Parameters
element
IModelElementThe element that should be looked for
Returns
- string
A fragment of the relative URI
GetReturnResult()
Retrieves the (only) return result parameter for this operation.
public IParameter GetReturnResult()
Returns
GetType()
If this operation has a return parameter, type equals the value of type for that parameter. Otherwise type has no value. result = (if returnResult()->notEmpty() then returnResult()->any(true).type else null endif) <p>From package UML::Classification.</p>
public IType GetType()
Returns
GetUpper()
If this operation has a return parameter, upper equals the value of upper for that parameter. Otherwise upper has no value. result = (if returnResult()->notEmpty() then returnResult()->any(true).upper else null endif) <p>From package UML::Classification.</p>
public void GetUpper()
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
Returns
InputParameters()
The ownedParameters with direction in and inout. result = (ownedParameter->select(direction=ParameterDirectionKind::_'in' or direction=ParameterDirectionKind::inout)) <p>From package UML::Classification.</p>
public IOrderedSetExpression<IParameter> InputParameters()
Returns
IsCompatibleWith(IParameterableElement)
The query isCompatibleWith() determines if this ParameterableElement is compatible with the specified ParameterableElement. By default, this ParameterableElement is compatible with another ParameterableElement p if the kind of this ParameterableElement is the same as or a subtype of the kind of p. Subclasses of ParameterableElement should override this operation to specify different compatibility constraints. result = (self.oclIsKindOf(p.oclType())) <p>From package UML::CommonStructure.</p>
public bool IsCompatibleWith(IParameterableElement p)
Parameters
Returns
IsTemplate()
The query isTemplate() returns whether this TemplateableElement is actually a template. result = (ownedTemplateSignature <> null) <p>From package UML::CommonStructure.</p>
public bool IsTemplate()
Returns
IsTemplateParameter()
The query isTemplateParameter() determines if this ParameterableElement is exposed as a formal TemplateParameter. result = (templateParameter->notEmpty()) <p>From package UML::CommonStructure.</p>
public bool IsTemplateParameter()
Returns
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
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Only_body_for_query(object, object)
A bodyCondition can only be specified for a query Operation. bodyCondition <> null implies isQuery
public bool Only_body_for_query(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
OutputParameters()
The ownedParameters with direction out, inout, or return. result = (ownedParameter->select(direction=ParameterDirectionKind::out or direction=ParameterDirectionKind::inout or direction=ParameterDirectionKind::return)) <p>From package UML::Classification.</p>
public IOrderedSetExpression<IParameter> OutputParameters()
Returns
ParameterableElements()
The query parameterableElements() returns the set of ParameterableElements that may be used as the parameteredElements for a TemplateParameter of this TemplateableElement. By default, this set includes all the ownedElements. Subclasses may override this operation if they choose to restrict the set of ParameterableElements. result = (self.allOwnedElements()->select(oclIsKindOf(ParameterableElement)).oclAsType(ParameterableElement)->asSet()) <p>From package UML::CommonStructure.</p>
public ISetExpression<IParameterableElement> ParameterableElements()
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 (direction = ParameterDirectionKind::return)->asSet()) <p>From package UML::Classification.</p>
public ISetExpression<IParameter> ReturnResult()
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
SetIsOrdered(bool)
public void SetIsOrdered(bool newIsOrdered)
Parameters
newIsOrdered
bool
SetIsUnique(bool)
public void SetIsUnique(bool newIsUnique)
Parameters
newIsUnique
bool
SetLower(int)
public void SetLower(int newLower)
Parameters
newLower
int
SetType(IType)
public void SetType(IType newType)
Parameters
newType
IType
SetUpper(object)
public void SetUpper(object newUpper)
Parameters
newUpper
object