33 lines
1.4 KiB
C#
33 lines
1.4 KiB
C#
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
using RulesEngine.Models;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace RulesEngine.Interfaces
|
|
{
|
|
public interface IRulesEngine
|
|
{
|
|
/// <summary>
|
|
/// This will execute all the rules of the specified workflow
|
|
/// </summary>
|
|
/// <param name="workflowName">The name of the workflow with rules to execute against the inputs</param>
|
|
/// <param name="inputs">A variable number of inputs</param>
|
|
/// <returns>List of rule results</returns>
|
|
ValueTask<List<RuleResultTree>> ExecuteAllRulesAsync(string workflowName, params object[] inputs);
|
|
|
|
/// <summary>
|
|
/// This will execute all the rules of the specified workflow
|
|
/// </summary>
|
|
/// <param name="workflowName">The name of the workflow with rules to execute against the inputs</param>
|
|
/// <param name="ruleParams">A variable number of rule parameters</param>
|
|
/// <returns>List of rule results</returns>
|
|
ValueTask<List<RuleResultTree>> ExecuteAllRulesAsync(string workflowName, params RuleParameter[] ruleParams);
|
|
ValueTask<ActionRuleResult> ExecuteActionWorkflowAsync(string workflowName, string ruleName, RuleParameter[] ruleParameters);
|
|
void AddWorkflow(params WorkflowRules[] workflowRules);
|
|
void ClearWorkflows();
|
|
void RemoveWorkflow(params string[] workflowNames);
|
|
}
|
|
}
|