Table of Contents

Class AutomationTrigger<TData>

Namespace
CMS.Automation
Assembly
CMS.Automation.dll

Base class for custom automation triggers with a typed trigger data payload. Extend this class to define a custom trigger that carries strongly-typed data to downstream automation actions when fired via FireTrigger<TTrigger>(AutomationTriggerDispatch, CancellationToken). A single instance is created and reused across all evaluations, so implementations must be stateless.

public abstract class AutomationTrigger<TData> : IAutomationTrigger where TData : class, IAutomationTriggerData

Type Parameters

TData

Type of the trigger data payload 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.

Inheritance
object
AutomationTrigger<TData>
Implements
Extension Methods

Constructors

AutomationTrigger()

protected AutomationTrigger()

Methods

Evaluate(AutomationTriggerContext, TData, CancellationToken)

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

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

Parameters

context AutomationTriggerContext

Information about the object the trigger was fired against.

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.