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
TDataType 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
-
objectAutomationTrigger<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
contextAutomationTriggerContextInformation about the object the trigger was fired against.
triggerDataTDataTyped payload supplied when the trigger was fired.
cancellationTokenCancellationTokenCancellation token.