OCL General Operators
No edit summary
No edit summary
Line 7: Line 7:
!Description
!Description
|-
|-
|'''[https://wiki.mdriven.net/index.php/OCLOperators_allInstances allInstances]'''
|'''[[Documentation:OCLOperators allInstances|allInstances]]'''
|All the objects of the class
|All the objects of the class
|-
|-
|'''[[OCLOperators allInstancesAtTime|allinstancesAtTime]]'''
|'''[[Documentation:OCLOperators allInstancesAtTime|allinstancesAtTime]]'''
|All the currently loaded instances
|All the currently loaded instances
|-
|-
|[[OCLOperators allLoadedObjects|'''allLoadedObjects''']]
|'''[[Documentation:OCLOperators allLoadedObjects|allLoadedObjects]]'''
|All objects currently in memory, excluding deleted objects
|All objects currently in memory, excluding deleted objects
|-
|-
|'''[[OCLOperators allStates|allStates]]'''
|'''[[Documentation:OCLOperators allStates|allStates]]'''
|Meta information about available states in state machines the class may contain
|Meta information about available states in state machines the class may contain
|-
|-
|'''[[OCLOperators allSubClasses|allSubClasses]]'''
|'''[[Documentation:OCLOperators allSubClasses|allSubClasses]]'''
|Meta information on all the sub-classes this class has
|Meta information on all the sub-classes this class has
|-
|-
|'''[[OCLOperators allSuperTypes|allSuperTypes]]'''
|'''[[Documentation:OCLOperators allSuperTypes|allSuperTypes]]'''
|Meta information on all the super-classes – in inheritance order the class has
|Meta information on all the super-classes – in inheritance order the class has
|-
|-
Line 28: Line 28:
|The set of symbols and characters used to specify constraints on objects in software development.
|The set of symbols and characters used to specify constraints on objects in software development.
|-
|-
|'''[[OCLOperators associationEnds|associationEnds]]'''
|'''[[Documentation:OCLOperators associationEnds|associationEnds]]'''
|Returns a collection of strings with association names for the class
|Returns a collection of strings with association names for the class
|-
|-
|[[OCLOperators associationEndsWithType|'''associationEndsWithType''']]
|'''[[Documentation:OCLOperators associationEndsWithType|associationEndsWithType]]'''
|Returns a collection of strings with association names and type information for the class
|Returns a collection of strings with association names and type information for the class
|-
|-
|'''[[OCLOperators asString|asString]]'''
|'''[[Documentation:OCLOperators asString|asString]]'''
|The string representation of the class – the asString operation is available on everything
|The string representation of the class – the asString operation is available on everything
|-
|-
Line 40: Line 40:
|Returns a json string defined by the ViewModel
|Returns a json string defined by the ViewModel
|-
|-
|[[OCLOperators atTime|'''atTime''']]
|'''[[Documentation:OCLOperators atTime|atTime]]'''
|Gives the read-only representation of a versioned object as it was at time X.
|Gives the read-only representation of a versioned object as it was at time X.
|-
|-
|'''[[OCLOperators attributes|Attributes]]'''
|'''[[Documentation:OCLOperators attributes|Attributes]]'''
|Meta information about what attributes the class has
|Meta information about what attributes the class has
|-
|-
|[[OCLOperators BigEndianUnicode|'''BigEndianUnicode''']]
|'''[[Documentation:OCLOperators BigEndianUnicode|BigEndianUnicode]]'''
|A data encoding format for Unicode characters
|A data encoding format for Unicode characters
|-
|-
|[[OCLOperators brokenConstraints|'''brokenConstraints''']]
|'''[[Documentation:OCLOperators brokenConstraints|brokenConstraints]]'''
|Returns a collection of the names of broken constraints for the class and object.
|Returns a collection of the names of broken constraints for the class and object.
|-
|-
|[[OCLOperators canAccess|'''canAccess''']]
|'''[[Documentation:OCLOperators canAccess|canAccess]]'''
|Check ViewModels Access expression for root
|Check ViewModels Access expression for root
|-
|-
|'''[[OCLOperators constraints|Constraints]]'''
|'''[[Documentation:OCLOperators constraints|Constraints]]'''
|Meta information on what constraints the class has
|Meta information on what constraints the class has
|-
|-
|[[OCLOperators count|'''count''']]
|'''[[Documentation:OCLOperators count|count]]'''
|Returns how many times the ''object'' is in the collection ''self''.
|Returns how many times the ''object'' is in the collection ''self''.
|-
|-
|[[OCLOperators Empty|'''Empty''']]
|'''[[Documentation:OCLOperators Empty|Empty]]'''
|Used to check if a collection or string is empty or not
|Used to check if a collection or string is empty or not
|-
|-
|'''[[OCLOperators emptyList|emptylist]]'''
|'''[[Documentation:OCLOperators emptyList|emptylist]]'''
|Returns an empty list typed to hold objects of the class
|Returns an empty list typed to hold objects of the class
|-
|-
|[[OCLOperators existing|'''existing''']]
|'''[[Documentation:OCLOperators existing|existing]]'''
|The existing operator returns true if the object hasn't been deleted.
|The existing operator returns true if the object hasn't been deleted.
|-
|-
|[[OCLOperators externalId|'''externalId''']]
|'''[[Documentation:OCLOperators externalId|externalId]]'''
|Returns the external ID for the object operated on.
|Returns the external ID for the object operated on.
|-
|-
|[[OCLOperators format|'''format''']]
|'''[[Documentation:OCLOperators format|format]]'''
|Used to create formatted strings based on a given pattern.
|Used to create formatted strings based on a given pattern.
|-
|-
|[[OCLOperators IsDirty|'''IsDirty''']]
|'''[[Documentation:OCLOperators IsDirty|IsDirty]]'''
|Returns true if the objects have been changed since the last save.
|Returns true if the objects have been changed since the last save.
|-
|-
|[[OCLOperators IsNew|'''IsNew''']]
|'''[[Documentation:OCLOperators IsNew|IsNew]]'''
|IsNew operator returns true if the object has never been saved to the database.
|IsNew operator returns true if the object has never been saved to the database.
|-
|-
Line 88: Line 88:
|Returns true if the value is null (not assigned any value).
|Returns true if the value is null (not assigned any value).
|-
|-
|[[OCLOperators maxValue|'''maxValue''']]
|'''[[Documentation:OCLOperators maxValue|maxValue]]'''
|Gets the maximum value in a collection of values
|Gets the maximum value in a collection of values
|-
|-
|[[OCLOperators minValue|'''minValue''']]
|'''[[Documentation:OCLOperators minValue|minValue]]'''
|Gets the minimum value in a collection of values
|Gets the minimum value in a collection of values
|-
|-
|'''[[OCLOperators nullValue|nullValue]]'''
|'''[[Documentation:OCLOperators nullValue|nullValue]]'''
|A typed null value
|A typed null value
|-
|-
|'''[[OCLOperators objectfromExternalId|objectFromExternalId]]'''
|'''[[Documentation:OCLOperators objectfromExternalId|objectFromExternalId]]'''
|An external identity will be resolved to the object
|An external identity will be resolved to the object
|-
|-
|'''[[OCLOperators oclAsType|oclAsType]]'''
|'''[[Documentation:OCLOperators oclAsType|oclAsType]]'''
|The type of the class
|The type of the class
|-
|-
|[[OCLOperators oclGetStates|'''oclGetStates''']]
|'''[[Documentation:OCLOperators oclGetStates|oclGetStates]]'''
|Gets a list of the objects all state machines currently state as strings.
|Gets a list of the objects all state machines currently state as strings.
|-
|-
|'''[[oclIsInvalid]]'''
|'''[[Documentation:OclIsInvalid|oclIsInvalid]]'''
|Returns true if ''self'' is equal to *invalid*.
|Returns true if ''self'' is equal to *invalid*.
|-
|-
|'''[[OCLOperators oclIsKindOf|oclIsKindOf]]'''
|'''[[Documentation:OCLOperators oclIsKindOf|oclIsKindOf]]'''
|This is to if a class is a subclass or as the class itself and not unrelated
|This is to if a class is a subclass or as the class itself and not unrelated
|-
|-
|'''[[OCLOperators oclIsTypeOf|oclIsTypeOf]]'''
|'''[[Documentation:OCLOperators oclIsTypeOf|oclIsTypeOf]]'''
|Returns true if
|Returns true if
|-
|-
|[[OCLOperators OnCreate|'''OnCreate''']]
|'''[[Documentation:OCLOperators OnCreate|OnCreate]]'''
|Is often called when a new object has been created.
|Is often called when a new object has been created.
|-
|-
|[[OCLOperators OnUpdate|'''OnUpdate''']]
|'''[[Documentation:OCLOperators OnUpdate|OnUpdate]]'''
|Is called just before the object is saved to the database.
|Is called just before the object is saved to the database.
|-
|-
|[[oclIsUndefined|'''oclIsUndefined''']]
|'''[[Documentation:OclIsUndefined|oclIsUndefined]]'''
|Returns true if ''self'' is equal to invalid or null.
|Returns true if ''self'' is equal to invalid or null.
|-
|-
|'''[[OCLOperators OclType|OclType]]'''
|'''[[Documentation:OCLOperators OclType|OclType]]'''
|When used on an object, you get the type of the object.
|When used on an object, you get the type of the object.
|-
|-
|[[OCLOperators random|'''random''']]
|'''[[Documentation:OCLOperators random|random]]'''
|Used to generate a random value within a specified range or collection
|Used to generate a random value within a specified range or collection
|-
|-
|'''[[OCLOperators safeCast|safeCast]]'''
|'''[[Documentation:OCLOperators safeCast|safeCast]]'''
|Used to safely cast an object to a subtype.
|Used to safely cast an object to a subtype.
|-
|-
|[[OCLOperators Sqlpassthrough|'''sqlpassthrough''']]
|'''[[Documentation:OCLOperators sqlpassthrough|sqlpassthrough]]'''
|Calls a stored procedure
|Calls a stored procedure
|-
|-
|[[OCLOperators sqlpassthroughobjects|'''sqlpassthroughobjects''']]
|'''[[Documentation:OCLOperators sqlpassthroughobjects|sqlpassthroughobjects]]'''
|Return a primary key of SomeClass. This can be combined with other Ocl-PS via ->intersection or union.  
|Return a primary key of SomeClass. This can be combined with other Ocl-PS via ->intersection or union.  
|-
|-
|'''[[OCLOperators superTypes|superTypes]]'''
|'''[[Documentation:OCLOperators superTypes|superTypes]]'''
|Returns the set of all direct supertypes of the type.
|Returns the set of all direct supertypes of the type.
|-
|-
|'''[[OCLOperators taggedValue|TaggedValue]]'''
|'''[[Documentation:OCLOperators taggedValue|TaggedValue]]'''
|Meta information on tagged values set in the class
|Meta information on tagged values set in the class
|-
|-
|'''[[OCLOperators taggedValueOnFeature|TaggedValueOnFeature]]'''
|'''[[Documentation:OCLOperators taggedValueOnFeature|TaggedValueOnFeature]]'''
|Meta information on Tagged values set on a named feature in the class
|Meta information on Tagged values set on a named feature in the class
|-
|-
|'''[[OCLOperators typename|Typename]]'''
|'''[[Documentation:OCLOperators typename|Typename]]'''
|The type name as a string
|The type name as a string
|-
|-
|'''[[OCLOperators ViewModels|ViewModels]]'''
|'''[[Documentation:OCLOperators ViewModels|ViewModels]]'''
|A tuple with the ViewModels for this class a members
|A tuple with the ViewModels for this class a members
|}
|}


'''See also:''' https://wiki.mdriven.net/index.php/OCLOperators
'''See also:''' [[Training:OCLOperators|OCLOperators]]

Revision as of 05:38, 4 February 2025

This page was created by Stephanie@mdriven.net on 2023-04-14. Last edited by Stephanie@mdriven.net on 2025-03-18.

General Operators

To find all available operators, you can open the OCL-Editor and type in a class:

Ocl-editor 1.png

Operators Description
allInstances All the objects of the class
allinstancesAtTime All the currently loaded instances
allLoadedObjects All objects currently in memory, excluding deleted objects
allStates Meta information about available states in state machines the class may contain
allSubClasses Meta information on all the sub-classes this class has
allSuperTypes Meta information on all the super-classes – in inheritance order the class has
ASCII The set of symbols and characters used to specify constraints on objects in software development.
associationEnds Returns a collection of strings with association names for the class
associationEndsWithType Returns a collection of strings with association names and type information for the class
asString The string representation of the class – the asString operation is available on everything
asTaJson Returns a json string defined by the ViewModel
atTime Gives the read-only representation of a versioned object as it was at time X.
Attributes Meta information about what attributes the class has
BigEndianUnicode A data encoding format for Unicode characters
brokenConstraints Returns a collection of the names of broken constraints for the class and object.
canAccess Check ViewModels Access expression for root
Constraints Meta information on what constraints the class has
count Returns how many times the object is in the collection self.
Empty Used to check if a collection or string is empty or not
emptylist Returns an empty list typed to hold objects of the class
existing The existing operator returns true if the object hasn't been deleted.
externalId Returns the external ID for the object operated on.
format Used to create formatted strings based on a given pattern.
IsDirty Returns true if the objects have been changed since the last save.
IsNew IsNew operator returns true if the object has never been saved to the database.
isDirtyMember Called on a class attribute to check if this attribute has changes pending to be saved.
isNull Returns true if the value is null (not assigned any value).
maxValue Gets the maximum value in a collection of values
minValue Gets the minimum value in a collection of values
nullValue A typed null value
objectFromExternalId An external identity will be resolved to the object
oclAsType The type of the class
oclGetStates Gets a list of the objects all state machines currently state as strings.
oclIsInvalid Returns true if self is equal to *invalid*.
oclIsKindOf This is to if a class is a subclass or as the class itself and not unrelated
oclIsTypeOf Returns true if
OnCreate Is often called when a new object has been created.
OnUpdate Is called just before the object is saved to the database.
oclIsUndefined Returns true if self is equal to invalid or null.
OclType When used on an object, you get the type of the object.
random Used to generate a random value within a specified range or collection
safeCast Used to safely cast an object to a subtype.
sqlpassthrough Calls a stored procedure
sqlpassthroughobjects Return a primary key of SomeClass. This can be combined with other Ocl-PS via ->intersection or union.
superTypes Returns the set of all direct supertypes of the type.
TaggedValue Meta information on tagged values set in the class
TaggedValueOnFeature Meta information on Tagged values set on a named feature in the class
Typename The type name as a string
ViewModels A tuple with the ViewModels for this class a members

See also: OCLOperators

Pages in category "OCL General Operators"

The following 49 pages are in this category, out of 49 total.

O

MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments