Class AutomationProcessContext
- Namespace
- CMS.Automation
- Assembly
- CMS.Automation.dll
Provides context data for automation action execution.
public sealed class AutomationProcessContext
- Inheritance
-
objectAutomationProcessContext
- Extension Methods
Properties
Process
Metadata describing the automation process executing the automation action.
public AutomationProcessMetadata Process { get; }
Property Value
Methods
GetProcessData<T>(CancellationToken)
Retrieves custom process data of the specified type that has been persisted across automation steps.
public Task<T> GetProcessData<T>(CancellationToken cancellationToken = default) where T : class, IAutomationProcessData
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<T>
The deserialized data, or
nullwhen no entry exists for the type or when the stored value cannot be deserialized.
Type Parameters
TType representing the custom process data. Must implement IAutomationProcessData.
Remarks
Deserialization failures are logged at debug level; the next call to SetProcessData<T>(T, CancellationToken) overwrites the malformed entry.
GetTriggerData<T>(CancellationToken)
Gets the trigger data captured when the process started, typed as T.
public Task<T> GetTriggerData<T>(CancellationToken cancellationToken = default) where T : IAutomationTriggerData
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<T>
The trigger data when it is a
T; otherwisenullwhen no trigger data was captured or the captured data is not aT.
Type Parameters
TExpected trigger data type. Use IAutomationTriggerData to get the raw value and check its type manually.
GetTriggerIdentifier(CancellationToken)
Gets the identifier of the trigger that started the process.
public Task<string> GetTriggerIdentifier(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<string>
SetProcessData<T>(T, CancellationToken)
Stores custom process data that persists across automation steps for the current process.
public Task SetProcessData<T>(T data, CancellationToken cancellationToken = default) where T : class, IAutomationProcessData
Parameters
dataTThe data to store.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Type Parameters
TType representing the custom process data. Must implement IAutomationProcessData.
Exceptions
- ArgumentNullException
Thrown when
datais null.