Interface IAutomationTaskStore
Represents a store for automation tasks, providing persistence and retrieval operations. Handles serialization/deserialization of task settings from JSON and coordinates database queries.
Namespace: DataWeb.Automation
Assembly: DataWeb.Core.dll
Syntax
public interface IAutomationTaskStore
Properties
Name
Gets the name of the automation task store implementation.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| string | A string identifying the store implementation (e.g., "SqlServer"). |
Methods
GetTaskAsync(AutomationTaskFilter, CancellationToken)
Asynchronously retrieves the first automation task matching the specified filter criteria.
Declaration
Task<AutomationTaskData> GetTaskAsync(AutomationTaskFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationTaskFilter | filter | The AutomationTaskFilter criteria used to query the automation task. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<AutomationTaskData> | A task that represents the asynchronous operation. The task result contains the first matching AutomationTaskData, or null if no match is found. |
GetTasksAsync(AutomationTaskFilter, CancellationToken)
Asynchronously retrieves a collection of automation tasks matching the specified filter criteria. Executes database query, deserializes JSON settings (trigger, execution, sandbox, schedule), and returns populated task data.
Declaration
Task<IEnumerable<AutomationTaskData>> GetTasksAsync(AutomationTaskFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AutomationTaskFilter | filter | The AutomationTaskFilter criteria containing IdMaster, ScenarioIdMaster, Name, Count, and PublishMode filters. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AutomationTaskData>> | A task that represents the asynchronous operation. The task result contains an enumerable collection of AutomationTaskData with fully deserialized settings and parameters. |
SetExecutionEndDateAsync(string, DateTimeOffset?, CancellationToken)
Asynchronously updates the execution end date of the specified automation task in the database.
Declaration
Task SetExecutionEndDateAsync(string taskIdMaster, DateTimeOffset? date, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | taskIdMaster | The unique master identifier of the task to update. |
| DateTimeOffset? | date | The execution end date to set. Pass null to clear the existing value. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation of updating the execution end date. |
SetExecutionStartDateAsync(string, DateTimeOffset?, CancellationToken)
Asynchronously updates the execution start date of the specified automation task in the database.
Declaration
Task SetExecutionStartDateAsync(string taskIdMaster, DateTimeOffset? date, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | taskIdMaster | The unique master identifier of the task to update. |
| DateTimeOffset? | date | The execution start date to set. Pass null to clear the existing value. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation of updating the execution start date. |
SetStatusAsync(string, AutomationTaskStatus, CancellationToken)
Asynchronously updates the execution status of the specified automation task in the database.
Declaration
Task SetStatusAsync(string taskIdMaster, AutomationTaskStatus status, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | taskIdMaster | The unique master identifier of the task to update. |
| AutomationTaskStatus | status | The new AutomationTaskStatus value to set for the task. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation of updating the task status. |