ReadUnionInstance
Presents a Union of Templates as resolved for the active execution, with membership checks and selection of Items across its member Templates.
Remarks
Section titled “Remarks”An Item belongs to the Union when its Template is a member. The Workspace Item is never a Union member.
- Data model
- UnionBuilder for declaring a Union
- UnionDefinition for the emitted Definition
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TReadItem
Section titled “TReadItem”TReadItem extends ReadItem = ReadItem
The Item type generated for this Union’s members.
Properties
Section titled “Properties”
readonlyprn:string
The PRN of the resource, for example prn::identity:template/user.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”getItem()
Section titled “getItem()”getItem(
id):Promise<TReadItem|undefined>
Loads an Item by identifier when it belongs to a member Template.
Parameters
Section titled “Parameters”string
The Item identifier.
Returns
Section titled “Returns”Promise<TReadItem | undefined>
The Item, or undefined when the active principal cannot read it or its Template is not a member.
isMember()
Section titled “isMember()”isMember(
template):boolean
Reports whether a Template belongs to this Union.
Parameters
Section titled “Parameters”template
Section titled “template”The Template, or anything carrying its PRN.
Returns
Section titled “Returns”boolean
isType()
Section titled “isType()”isType(
value):value is TReadItem
Reports whether a value is an Item of one of the member Templates, narrowing its type when it is.
Parameters
Section titled “Parameters”unknown
The value to test.
Returns
Section titled “Returns”value is TReadItem
memberPrns()
Section titled “memberPrns()”memberPrns():
string[]
Lists the PRNs of the member Templates.
Returns
Section titled “Returns”string[]
selectItems()
Section titled “selectItems()”selectItems():
UnionCursorSelector<ReadItem>
Starts a selection over the Items of every member Template.

