TransformDataEventSchema

@Serializable
@SerialName(value = "TransformData")
data class TransformDataEventSchema(val id: String, val trigger: EventTrigger, val events: SerializableImmutableList<EventSchema>?, val template: AnySerializable, val applyPerItem: Boolean = false) : EventSchema

Reshapes the event's incomingData into a new value by applying template through the client's TemplateProcessor, letting a payload be rewritten mid-chain without a round trip.

With applyPerItem set and an incomingData that is a List, the template is applied to each item on its own — <||> is then the item itself and <|a.b|> a field of it — and the result is the list of the outcomes, in order (an empty list gives an empty list). An incomingData that is not a list is transformed as a whole, ignoring the flag.

incomingData consumed: it is the input the template is applied to.

Triggers fired:

  • OnSuccessEventTrigger — when the template was applied; the transformed value is passed as incomingData.

  • OnFailureEventTrigger — when applying the template throws; the Throwable is passed as incomingData and the error is logged.

Constructors

Link copied to clipboard
constructor(id: String, trigger: EventTrigger, events: SerializableImmutableList<EventSchema>?, template: AnySerializable, applyPerItem: Boolean = false)

Properties

Link copied to clipboard
@SerialName(value = "applyPerItem")
val applyPerItem: Boolean
Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?

This event's own children — each declaring, via its own trigger, which of this event's outgoing triggers runs it. null when this event declares no children.

Link copied to clipboard
@SerialName(value = "id")
open override val id: String

Unique identifier — how TriggerEvent/UpdateEvents address this event by id. Defaults to a random id when omitted from the DSL.

Link copied to clipboard
@SerialName(value = "template")
val template: AnySerializable
Link copied to clipboard
@SerialName(value = "trigger")
open override val trigger: EventTrigger

The condition that must occur for this event to run — matched by structural equality (data class/data object equality) against whatever trigger value fired, never by any kind of subscription or listener registry.