-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update DSL implementation and integration (#4073)
- Loading branch information
1 parent
7d56d00
commit 6f455f7
Showing
53 changed files
with
957 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 25 additions & 1 deletion
26
src/modules/Elsa.Dsl/Contracts/IFunctionActivityRegistry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
using Elsa.Dsl.Models; | ||
using Elsa.Workflows.Core.Contracts; | ||
|
||
namespace Elsa.Dsl.Contracts; | ||
|
||
/// <summary> | ||
/// Provides a registry for mapping functions to activities that can be invoked from a DSL script. | ||
/// </summary> | ||
public interface IFunctionActivityRegistry | ||
{ | ||
void RegisterFunction(string functionName, string activityTypeName, IEnumerable<string>? propertyNames = default); | ||
/// <summary> | ||
/// Registers a function that is mapped to an activity that can be invoked from a DSL script. | ||
/// </summary> | ||
/// <param name="functionName">The name of the function.</param> | ||
/// <param name="activityTypeName">The name of the activity type.</param> | ||
/// <param name="propertyNames">The names of the properties that are mapped to the function arguments.</param> | ||
/// <param name="configure">An optional action that can be used to configure the activity.</param> | ||
void RegisterFunction(string functionName, string activityTypeName, IEnumerable<string>? propertyNames = default, Action<IActivity>? configure = default); | ||
|
||
/// <summary> | ||
/// Registers a function that is mapped to an activity that can be invoked from a DSL script. | ||
/// </summary> | ||
/// <param name="descriptor">The descriptor that describes the function.</param> | ||
void RegisterFunction(FunctionActivityDescriptor descriptor); | ||
|
||
/// <summary> | ||
/// Resolves a function to an activity that can be invoked from a DSL script. | ||
/// </summary> | ||
/// <param name="functionName">The name of the function.</param> | ||
/// <param name="arguments">The arguments that are passed to the function.</param> | ||
/// <returns>An activity that can be invoked from a DSL script.</returns> | ||
IActivity ResolveFunction(string functionName, IEnumerable<object?>? arguments = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Elsa.Workflows.Core.Contracts; | ||
|
||
namespace Elsa.Dsl.Models; | ||
|
||
/// <summary> | ||
/// Describes a function that is mapped to an activity that can be invoked from a DSL script. | ||
/// </summary> | ||
/// <param name="FunctionName">The name of the function.</param> | ||
/// <param name="ActivityTypeName">The name of the activity type.</param> | ||
/// <param name="PropertyNames">The names of the properties that are mapped to the function arguments.</param> | ||
/// <param name="Configure">An optional action that can be used to configure the activity.</param> | ||
public record FunctionActivityDescriptor(string FunctionName, string ActivityTypeName, IEnumerable<string>? PropertyNames = default, Action<IActivity>? Configure = default); |
Oops, something went wrong.