.object Macro

This macro returns a collection of objects based on the specified scope and condition. Object references are represented as OID; for example: E40D4254-DA4A-4FB6-AEF6-3E7B41A41AD1.

object = .object (scope:simple-template [,filter])

The following parameters are available:

Parameter

Description

scope

Collection over which we should iterate, the macro will return the first matching object in the collection

Type: Simple template returning either an object or a collection scope

simple-template

Template to be evaluated.

Type: Simple template

filter

Filter condition

Type: condition

The following macro returns the first attribute in the collection defined on the current classifier whose code starts with a letter comprised between a and e included.
.object(Attributes, (%.1:Code% >= a) and (%.1:Code% <= e))
In the following example, template ::myPackage2 is defined as:
.object(ActiveModel.Packages, %Name% == MyPackage2)
and template OOM.Model::MyTemplate is defined as:
.foreach_item(myPackage2.Classes)
%Code%
.next(\n)
In OOM.Model M = { OOM.Package MyPackage1, OOM.Package MyPackage2 { OOM.Class C1, OOM.Class C2} }, and template OOM.Model::MyTemplate evaluates to:
C1
C2
In the following example, this template in a DMM returns the first read-only data connection for the process associated with the current publication:
.object(Process.DataConnections, %AccessType% == "RO")