Class UML 2.4.1::Operation
Description:
An operation is a behavioral feature 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,
BehavioralFeature,
ParameterableElementDirect Subclasses: Class Precedence List: Operation,
TemplateableElement,
BehavioralFeature,
Namespace,
Feature,
RedefinableElement,
NamedElement,
ParameterableElement,
ElementProperties:
![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
bodyCondition :
Constraint (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
class :
Class (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
datatype :
DataType (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
interface :
Interface (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isOrdered : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isQuery : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isUnique : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
lower : Integer (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
postcondition :
Constraint (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
precondition :
Constraint (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
redefinedOperation :
Operation (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
templateParameter :
OperationTemplateParameter (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
type :
Type (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
upper : UnlimitedNatural (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedTemplateSignature :
TemplateSignature (0 1); -- source
TemplateableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
templateBinding :
TemplateBinding (0 *); -- source
TemplateableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
concurrency :
CallConcurrencyKind (1 1); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isAbstract : Boolean (1 1); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
method :
Behavior (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedParameter :
Parameter (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedParameterSet :
ParameterSet (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
raisedException :
Type (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
elementImport :
ElementImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
importedMember :
PackageableElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
member :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedMember :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedRule :
Constraint (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
packageImport :
PackageImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
featuringClassifier :
Classifier (0 *); -- source
Feature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isStatic : Boolean (1 1); -- source
Feature![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
isLeaf : Boolean (1 1); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
redefinedElement :
RedefinableElement (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
redefinitionContext :
Classifier (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
clientDependency :
Dependency (0 *); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
name : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
nameExpression :
StringExpression (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
namespace :
Namespace (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
qualifiedName : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
visibility :
VisibilityKind (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedComment :
Comment (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
ownedElement :
Element (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=59863%3AB4B41B834948FF0E9BCE9B5F7ADD70D0)
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))
Signature: only_body_for_query() : Boolean;
Description: A bodyCondition can only be specified for a query operation.
Expression: bodyCondition->notEmpty() implies isQuery
Signature: at_most_one_return() : Boolean;
Description: An operation can have at most one return parameter; i.e., an owned parameter
with the direction set to 'return'
Expression: self.ownedParameter->select(par | par.direction = #return)->size() <= 1
Operations:
Signature: upper.1() : UnlimitedNatural;
Description: If this operation has a return parameter, upper equals the value of upper
for that parameter. Otherwise upper is not defined.
Expression: result = if returnResult()->notEmpty() then returnResult()->any().upper else Set{} endif
Signature: type.1() : Type;
Description: If this operation has a return parameter, type equals the value of type
for that parameter. Otherwise type is not defined.
Expression: result = if returnResult()->notEmpty() then returnResult()->any().type else Set{} 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 (par | par.direction = #return)
Signature: lower.1() : Integer;
Description: If this operation has a return parameter, lower equals the value of lower
for that parameter. Otherwise lower is not defined.
Expression: result = if returnResult()->notEmpty() then returnResult()->any().lower else Set{} 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()->any().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()->any().isOrdered else false endif
Signature: isConsistentWith(redefinee : RedefinableElement; ) : Boolean;
Description: A redefining operation is consistent with a redefined operation if it has
the same number of owned parameters, and the type of each owned parameter
conforms to the type of the corresponding redefined parameter. The query
isConsistentWith() specifies, for any two Operations in a context in which
redefinition is possible, whether redefinition would be consistent in the
sense of maintaining type covariance. Other senses of consistency may be
required, for example to determine consistency in the sense of contravariance.
Users may define alternative queries under names different from 'isConsistentWith()',
as for example, users may define a query named 'isContravariantWith()'.
The OCL used here is not normative.Editor's notes: Needs investigation
Expression: true
Original: redefinee.isRedefinitionContextValid(self)
result = redefinee.oclIsKindOf(Operation) and let op : Operation = redefinee.oclAsType(Operation) in self.ownedParameter->size() = op.ownedParameter->size() and Sequence{1..self.ownedParameter->size()}-> forAll(i |op.ownedParameter->at(1).type.conformsTo(self.ownedParameter->at(i).type))
Send questions or comments to
[email protected].