🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Parsed/Enumerations
This page was created by PageReplicator on 2025-09-01. Last edited by PageReplicator on 2025-09-01.

Template:Notice



You can edit enumerations by right-clicking on any model element in the "model content" window.

<a href="/File:Edit_enumerations_menu.png" class="image" data-bs-title="File:Edit_enumerations_menu.png" data-bs-filetimestamp="20200323101806"><img alt="Edit enumerations menu.png" src="/images/a/ad/Edit_enumerations_menu.png" decoding="async" width="469" height="363" class="thumbimage" /></a>
<a href="/File:Edit_enumerations_menu.png" class="internal" title="Enlarge"></a>

The enumeration editing window:

<a href="/File:Defining_enumerations.png" class="image" data-bs-title="File:Defining_enumerations.png" data-bs-filetimestamp="20200323102223"><img alt="Defining enumerations.png" src="/images/7/74/Defining_enumerations.png" decoding="async" width="685" height="320" class="thumbimage" /></a>
<a href="/File:Defining_enumerations.png" class="internal" title="Enlarge"></a>

The defined enumeration is a class in the model's type system.

For example, you can return a list of the values. This returns a collection of ImportColumn <a href="/Documentation:Tuple" title="Documentation:Tuple" data-bs-title="Documentation:Tuple">Tuple</a>s.

ImportColumn.allInstances

Convert this to a list of strings for each Enum value (for example to be used in a list on screen):

ImportColumn.allInstances.asString
Select an Enum value from the list, then get the string value from that:[<a href="/index.php?title=Documentation:Enumerations&veaction=edit&section=1" class="mw-editsection-visualeditor" title="Edit section: Select an Enum value from the list, then get the string value from that:" data-bs-title="Documentation:Enumerations">edit</a> | <a href="/index.php?title=Documentation:Enumerations&action=edit&section=1" title="Edit section: Select an Enum value from the list, then get the string value from that:" data-bs-title="Documentation:Enumerations">edit source</a>]
ImportColumn.allInstances->select(ic|ic = #JournalName).asString
Get the value of an Enum <a href="/Documentation:Tuple" title="Documentation:Tuple" data-bs-title="Documentation:Tuple">tuple</a>:[<a href="/index.php?title=Documentation:Enumerations&veaction=edit&section=2" class="mw-editsection-visualeditor" title="Edit section: Get the value of an Enum tuple:" data-bs-title="Documentation:Enumerations">edit</a> | <a href="/index.php?title=Documentation:Enumerations&action=edit&section=2" title="Edit section: Get the value of an Enum tuple:" data-bs-title="Documentation:Enumerations">edit source</a>]
(#JournalName).toString

(note: asString does not work on Enum tuples)

Checking if a collection includes a value[<a href="/index.php?title=Documentation:Enumerations&veaction=edit&section=3" class="mw-editsection-visualeditor" title="Edit section: Checking if a collection includes a value" data-bs-title="Documentation:Enumerations">edit</a> | <a href="/index.php?title=Documentation:Enumerations&action=edit&section=3" title="Edit section: Checking if a collection includes a value" data-bs-title="Documentation:Enumerations">edit source</a>]

You can't use the <a href="/Documentation:OCLOperators_includes" title="Documentation:OCLOperators includes" data-bs-title="Documentation:OCLOperators_includes">includes</a> operator on collections of Enum. You have to select the value and check if you get a "hit".

This works:

SysSingleton.SO.ActiveUser.UserModes->select(x|x = #Consultant)->notEmpty

This does not work: SysSingleton.SO.ActiveUser.UserModes->includes(#Consultant)

Checking the ordinal number of a enum value[<a href="/index.php?title=Documentation:Enumerations&veaction=edit&section=4" class="mw-editsection-visualeditor" title="Edit section: Checking the ordinal number of a enum value" data-bs-title="Documentation:Enumerations">edit</a> | <a href="/index.php?title=Documentation:Enumerations&action=edit&section=4" title="Edit section: Checking the ordinal number of a enum value" data-bs-title="Documentation:Enumerations">edit source</a>]

MyEnum.allinstances.Indexof(someObject.SomeEnumProp)