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
TDataType 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.
TPropertiesType 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
-
objectAutomationTrigger<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
contextAutomationTriggerContextInformation about the object the trigger was fired against.
propertiesTPropertiesMarketer-configured properties of the trigger step, populated from the saved automation process.
triggerDataTDataTyped payload supplied when the trigger was fired.
cancellationTokenCancellationTokenCancellation token.