Class Automation
This class is responsible for managing and executing automations. Automations are a set of conditions and actions that should happen automatically under certain circumstances. The AutomationService takes in dependencies for:
- IAutomationManager: This manages getting a list of defined automations
- IOptions: This provides configuration options
- ILogger: This is used for logging It has a method called RefreshAutomationsAsync() which will call the IAutomationManager to get an updated list of all automations that are defined. The ValidateConditionsAsync method takes an automation and a value, and checks if all the conditions defined in that automation evaluate to true for the provided value.This determines if the automation should execute based on the conditions. The ExecuteAsync method takes an automation, a value, and a cancellation token. It will execute the series of actions defined in the automation one by one until complete or cancelled.The actions transform the provided value in some way to accomplish the purpose of the automation. Overall, this class handles getting the defined automations, evaluating if an automation should execute based on conditions, and then executing the actions of an automation if triggered.It provides the core logic to enable automations in an application.
Implements
INotifyPropertyChanged
IDisposable
IDataErrorInfo
INotifyDataErrorInfo
Inherited Members
Namespace: ISynergy.Framework.Automations
Assembly: ISynergy.Framework.Automations.dll
Syntax
public class Automation : ObservableClass, IObservableClass, IBindable
Constructors
View SourceAutomation()
Default constructor for Automation.
Declaration
public Automation()
Properties
View SourceActions
Gets or sets the Actions property value.
Declaration
public ObservableCollection<IAction> Actions { get; set; }
Property Value
Type | Description |
---|---|
ObservableCollection<IAction> |
AutomationId
Gets or sets the AutomationId property value.
Declaration
public Guid AutomationId { get; }
Property Value
Type | Description |
---|---|
Guid |
Conditions
Gets or sets the Conditions property value.
Declaration
public ObservableCollection<ICondition> Conditions { get; set; }
Property Value
Type | Description |
---|---|
ObservableCollection<ICondition> |
Description
Gets or sets the Description property value.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ExecutionTimeout
Gets or sets the Excecution Timeout property value.
Declaration
public TimeSpan ExecutionTimeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
IsActive
Gets or sets the IsActive property value.
Declaration
public bool IsActive { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Mode
Gets or sets the Mode property value.
Declaration
public RunModes Mode { get; set; }
Property Value
Type | Description |
---|---|
RunModes |
Name
Gets or sets the Name property value.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Triggers
Gets or sets the Triggers property value.
Declaration
public ObservableCollection<object> Triggers { get; set; }
Property Value
Type | Description |
---|---|
ObservableCollection<System.Object> |
Implements
INotifyPropertyChanged
IDisposable
IDataErrorInfo
INotifyDataErrorInfo