🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators Qualify GenericAt0
This page was created by Vale.buyondo on 2026-03-04. Last edited by 62.169.16.147 on 2026-09-12.

Qualify_GenericAt0() is an internal fallback operator that MDriven uses when bracket qualifier syntax [ ] is applied to an association that has no explicit Qualify implementation. It retrieves a single object by index position from a named role defined on the model root (SysSingleton / ECOModelRoot).

Important[edit source]

This operator can only be called on the root class (SysSingleton). Calling it on any other class will throw: Second param must be a valid multilink name as string literal for class of root.

The second parameter must be the association role name as shown in the Roles panel of the OCL Editor not an attribute name.

Syntax[edit source]

SysSingleton.allInstances.Qualify_GenericAt0( <index> , '<roleName>' )
Parameter Type Description
index Int32 Zero-based position of the element to retrieve
roleName String Exact association role name defined on the root class

Example[edit source]

First, link an object to the root via an Action:

SysSingleton.allInstances->first().ApiSearchResults->add(Articles1.allInstances->first())

Then retrieve it by index:

SysSingleton.allInstances.Qualify_GenericAt0( 0 ,'ApiSearchResults' )

This returns the Articles1 object at index 0 from the ApiSearchResults role on SysSingleton.

Preferred alternatives[edit source]

-- Bracket syntax (recommended)

SysSingleton.allInstances->first().ApiSearchResults[0]

-- Standard OCL

SysSingleton.allInstances->first().ApiSearchResults->first()

Notes[edit source]

  • Returns null if the collection is empty or no object has been linked at runtime — even if instances of the target class exist independently
  • The role name must match exactly what appears under Roles in the OCL Editor right panel when SysSingleton is selected
  • Index is zero-based: 0 = first element