OCL General Operators
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== General Operators ==
To find all available operators, you can open the OCL-Editor and type in a class:
To find all available operators, you can open the OCL-Editor and type in a class:


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


'''See also:''' [[Training:OCLOperators|OCLOperators]]
'''See also:''' [[Documentation:OCLOperators|OCLOperators]]

Latest revision as of 05:27, 18 March 2025

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

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

Ocl-editor 1.png

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