UnionBuilder
Groups Templates so that Events, Relations and operation outputs can target any member.
Remarks
Section titled “Remarks”A Union is a membership list, not an inheritance mechanism: members keep their own Properties and Grants. Events declared on a Union are available on every member Item alongside the member’s own Events. Membership is resolved when the Definition is built, so Templates added further on in the spec are included.
- AppBuilder.addUnion
- Unions
- UnionDefinition for the emitted Definition
- ReadUnionInstance for the Union inside an execution
Extends
Section titled “Extends”Properties
Section titled “Properties”
readonlyprn:string
Platform Resource Name of the Union, derived from the App key and Union key.
Overrides
Section titled “Overrides”Methods
Section titled “Methods”addEvent()
Section titled “addEvent()”addEvent(
key):EventBuilder
Declares an Event that can be published against any member Item of this Union.
Parameters
Section titled “Parameters”string
Event key within the Union.
Returns
Section titled “Returns”The Event builder.
addRelation()
Section titled “addRelation()”addRelation(
key,cardinality,to,options?):RelationBuilder
Declares a Relation of the given cardinality from member Items of this Union to Items of to.
Parameters
Section titled “Parameters”string
Relation key on the Union.
cardinality
Section titled “cardinality”Cardinality read from the members to to.
TemplateBuilder | UnionBuilder
Target Template or Union.
options?
Section titled “options?”Naming of the reverse side; toKey defaults to key.
Returns
Section titled “Returns”The Relation builder.
Remarks
Section titled “Remarks”The Relation is registered on every member Template when the Definition is built, and the
build fails if toKey collides with a Relation key already declared on a target.
addTemplate()
Section titled “addTemplate()”addTemplate(
template):this
Adds one or more Templates to the Union membership. Adding a member twice adds it once.
Parameters
Section titled “Parameters”template
Section titled “template”TemplateBuilder | TemplateBuilder[]
Template or Templates to add.
Returns
Section titled “Returns”this
This builder for chaining.
setDescription()
Section titled “setDescription()”setDescription(
description):this
Sets the description emitted into the definition and rendered in generated reference and application assets.
Parameters
Section titled “Parameters”description
Section titled “description”string
Human-readable description of the resource.
Returns
Section titled “Returns”this
This builder for chaining.
Inherited from
Section titled “Inherited from”toDefinition()
Section titled “toDefinition()”toDefinition():
UnionDefinition
Emits the Definition of this Union, including the PRNs of its current members.

