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.

Constraints:

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-exceptionExpression: 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 setExpression: 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)) ))