Class UML 2.5::Operation
Description:
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.
Direct Superclasses: TemplateableElement,
ParameterableElement,
BehavioralFeatureDirect Subclasses: Class Precedence List: Operation,
TemplateableElement,
ParameterableElement,
BehavioralFeature,
Feature,
RedefinableElement,
Namespace,
NamedElement,
ElementProperties:
bodyCondition :
Constraint (0 1); -- source
Operation class :
Class (0 1); -- source
Operation datatype :
DataType (0 1); -- source
Operation interface :
Interface (0 1); -- source
OperationThe Interface that owns this Operation, if any.
Subsets: Feature.featuringClassifier, NamedElement.namespace, RedefinableElement.redefinitionContext
Opposite: Interface.ownedOperation
isOrdered : Boolean (1 1); -- source
Operation isQuery : Boolean (1 1); -- source
Operation isUnique : Boolean (1 1); -- source
Operation lower : Integer (0 1); -- source
Operation postcondition :
Constraint (0 *); -- source
Operation precondition :
Constraint (0 *); -- source
Operation redefinedOperation :
Operation (0 *); -- source
Operation templateParameter :
OperationTemplateParameter (0 1); -- source
Operation type :
Type (0 1); -- source
Operation upper : UnlimitedNatural (0 1); -- source
Operation ownedTemplateSignature :
TemplateSignature (0 1); -- source
TemplateableElement templateBinding :
TemplateBinding (0 *); -- source
TemplateableElement owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement concurrency :
CallConcurrencyKind (1 1); -- source
BehavioralFeature isAbstract : Boolean (1 1); -- source
BehavioralFeature method :
Behavior (0 *); -- source
BehavioralFeature ownedParameter :
Parameter (0 *); -- source
BehavioralFeature ownedParameterSet :
ParameterSet (0 *); -- source
BehavioralFeature raisedException :
Type (0 *); -- source
BehavioralFeature featuringClassifier :
Classifier (0 1); -- source
Feature isStatic : Boolean (1 1); -- source
Feature isLeaf : Boolean (1 1); -- source
RedefinableElement redefinedElement :
RedefinableElement (0 *); -- source
RedefinableElement redefinitionContext :
Classifier (0 *); -- source
RedefinableElement elementImport :
ElementImport (0 *); -- source
Namespace importedMember :
PackageableElement (0 *); -- source
Namespace member :
NamedElement (0 *); -- source
Namespace ownedMember :
NamedElement (0 *); -- source
Namespace ownedRule :
Constraint (0 *); -- source
Namespace packageImport :
PackageImport (0 *); -- source
Namespace clientDependency :
Dependency (0 *); -- source
NamedElement name : String (0 1); -- source
NamedElement nameExpression :
StringExpression (0 1); -- source
NamedElement namespace :
Namespace (0 1); -- source
NamedElementSpecifies the Namespace that owns the NamedElement.
{
readonly}
Derived union with sources: (interface, datatype, class)
Subsets: Element.owner
Opposite: Namespace.ownedMember
qualifiedName : String (0 1); -- source
NamedElement visibility :
VisibilityKind (0 1); -- source
NamedElement ownedComment :
Comment (0 *); -- source
Element ownedElement :
Element (0 *); -- source
Element owner :
Element (0 1); -- source
ElementConstraints:
Signature: CMOF_14_3_17a() : Boolean;
Description: 14.3 [17] An Operation can have up to one Parameter whose direction is 'return';
furthermore, an Operation cannot have any ParameterSet per 12.4 [8].
Expression: ownedParameter->select(direction = ParameterDirectionKind::return)->size() < 2 and
ownedParameterSet->isEmpty()
Signature: CMOF_14_3_2() : Boolean;
Description: 14.3 [2] The type of Operation::raisedException is limited to be Class rather than Type.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/operation-has-non-class-exception
Expression: raisedException->forAll(e | e.oclIsTypeOf(Class))
Operations:
Signature: upper.1() : UnlimitedNatural;
Description: If this operation has a return parameter, upper equals the value of upper
for that parameter. Otherwise upper has no value.
Expression: result = (if returnResult()->notEmpty() then returnResult()->any(true).upper else null endif)
Signature: type.1() : Type;
Description: If this operation has a return parameter, type equals the value of type
for that parameter. Otherwise type has no value.
Expression: result = (if returnResult()->notEmpty() then returnResult()->any(true).type else null endif)
Signature: returnResult() : Parameter;
Description: The query returnResult() returns the set containing the return parameter
of the Operation if one exists, otherwise, it returns an empty set
Expression: result = (ownedParameter->select (direction = ParameterDirectionKind::return))
Signature: lower.1() : Integer;
Description: If this operation has a return parameter, lower equals the value of lower
for that parameter. Otherwise lower has no value.
Expression: result = (if returnResult()->notEmpty() then returnResult()->any(true).lower else null endif)
Signature: isUnique.1() : Boolean;
Description: If this operation has a return parameter, isUnique equals the value of
isUnique for that parameter. Otherwise isUnique is true.
Expression: result = (if returnResult()->notEmpty() then returnResult()->exists(isUnique) else true endif)
Signature: isOrdered.1() : Boolean;
Description: If this operation has a return parameter, isOrdered equals the value of
isOrdered for that parameter. Otherwise isOrdered is false.
Expression: result = (if returnResult()->notEmpty() then returnResult()-> exists(isOrdered) else false endif)
Signature: isConsistentWith(redefiningElement : RedefinableElement; ) : Boolean;
Description: The query isConsistentWith() specifies, for any two Operations in a context
in which redefinition is possible, whether redefinition would be consistent.
A redefining operation is consistent with a redefined operation if it
has the same number of owned parameters, and for each parameter the following
holds: - Direction, ordering and uniqueness are the same. - The corresponding
types are covariant, contravariant or invariant. - The multiplicities
are compatible, depending on the parameter direction.
Expression: result = (redefiningElement.oclIsKindOf(Operation) and let op : Operation = redefiningElement.oclAsType(Operation) in self.ownedParameter->size() = op.ownedParameter->size() and Sequence{1..self.ownedParameter->size()}-> forAll(i | let redefiningParam : Parameter = op.ownedParameter->at(i), redefinedParam : Parameter = self.ownedParameter->at(i) in (redefiningParam.isUnique = redefinedParam.isUnique) and (redefiningParam.isOrdered = redefinedParam. isOrdered) and (redefiningParam.direction = redefinedParam.direction) and (redefiningParam.type.conformsTo(redefinedParam.type) or redefinedParam.type.conformsTo(redefiningParam.type)) and (redefiningParam.direction = ParameterDirectionKind::inout implies (redefinedParam.compatibleWith(redefiningParam) and redefiningParam.compatibleWith(redefinedParam))) and (redefiningParam.direction = ParameterDirectionKind::_'in' implies redefinedParam.compatibleWith(redefiningParam)) and ((redefiningParam.direction = ParameterDirectionKind::out or redefiningParam.direction = ParameterDirectionKind::return) implies redefiningParam.compatibleWith(redefinedParam)) ))
Send questions or comments to
[email protected].