Table of Contents

Class AutomationTrigger<TData, TProperties>

Namespace
CMS.Automation
Assembly
CMS.Automation.dll

Base class for custom automation triggers with both typed trigger data and configurable properties. Extend this class to define a custom trigger whose marketer-configured properties are evaluated when the trigger is fired. A single instance is created and reused across all evaluations, so implementations must be stateless.

public abstract class AutomationTrigger<TData, TProperties> : IAutomationTrigger where TData : class, IAutomationTriggerData where TProperties : IAutomationTriggerProperties, new()

Type Parameters

TData

Type of the trigger data supplied when firing the trigger. Must implement IAutomationTriggerData. The payload is JSON-serialized and persisted with the started automation process for downstream actions to read.

TProperties

Type of the configurable properties model. Properties annotated with form component attributes appear in the automation builder when a marketer configures the trigger step. Must implement IAutomationTriggerProperties and have a parameterless constructor.

Inheritance
object
AutomationTrigger<TData, TProperties>
Implements
Extension Methods

Constructors

AutomationTrigger()

protected AutomationTrigger()

Methods

Evaluate(AutomationTriggerContext, TProperties, TData, CancellationToken)

Returns whether the configured automation process should start for the object described by context, given the marketer-configured properties and the supplied triggerData. Override to gate the trigger; the default implementation always allows the process to start.

public virtual Task<bool> Evaluate(AutomationTriggerContext context, TProperties properties, TData triggerData, CancellationToken cancellationToken)

Parameters

context AutomationTriggerContext

Information about the object the trigger was fired against.

properties TProperties

Marketer-configured properties of the trigger step, populated from the saved automation process.

triggerData TData

Typed payload supplied when the trigger was fired.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

true to start the configured automation process; false to skip it.