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=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
bodyCondition :
Constraint (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
class :
Class (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
datatype :
DataType (0 1); -- source
Operation![](/se-interop/image/right-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
interface :
Interface (0 1); -- source
OperationThe Interface that owns this Operation.
Subsets: Feature.featuringClassifier, NamedElement.namespace, RedefinableElement.redefinitionContext
Opposite: Interface.ownedOperation
![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isOrdered : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isQuery : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isUnique : Boolean (1 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
lower : Integer (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
postcondition :
Constraint (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
precondition :
Constraint (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
redefinedOperation :
Operation (0 *); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
templateParameter :
OperationTemplateParameter (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
type :
Type (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
upper : UnlimitedNatural (0 1); -- source
Operation![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedTemplateSignature :
TemplateSignature (0 1); -- source
TemplateableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
templateBinding :
TemplateBinding (0 *); -- source
TemplateableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
concurrency :
CallConcurrencyKind (1 1); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isAbstract : Boolean (1 1); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
method :
Behavior (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedParameter :
Parameter (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedParameterSet :
ParameterSet (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
raisedException :
Type (0 *); -- source
BehavioralFeature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
elementImport :
ElementImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
importedMember :
PackageableElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
member :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedMember :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedRule :
Constraint (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
packageImport :
PackageImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
featuringClassifier :
Classifier (0 *); -- source
Feature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isStatic : Boolean (1 1); -- source
Feature![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
isLeaf : Boolean (1 1); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
redefinedElement :
RedefinableElement (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
redefinitionContext :
Classifier (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
clientDependency :
Dependency (0 *); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
name : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
nameExpression :
StringExpression (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
namespace :
Namespace (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
qualifiedName : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
visibility :
VisibilityKind (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedComment :
Comment (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
ownedElement :
Element (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=7328%3AB0CA441FC7796A5FA09259ABC969B82B)
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].