2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Workflows.Core;
|
2022-06-09 18:06:31 +00:00
|
|
|
using Elsa.Workflows.Core.Helpers;
|
|
|
|
|
using Elsa.Workflows.Core.Services;
|
2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Workflows.Runtime.Stimuli;
|
2022-01-04 08:42:12 +00:00
|
|
|
|
2022-05-26 10:47:31 +00:00
|
|
|
namespace Elsa.Workflows.Runtime.Models;
|
2022-01-04 08:42:12 +00:00
|
|
|
|
2022-02-22 11:51:59 +00:00
|
|
|
public static class Stimulus
|
2022-01-04 08:42:12 +00:00
|
|
|
{
|
2022-06-09 18:06:31 +00:00
|
|
|
public static StandardStimulus Standard<T>(string? hash = default, IDictionary<string, object>? input = default, string? correlationId = default) where T : IActivity =>
|
|
|
|
|
new(ActivityTypeNameHelper.GenerateTypeName<T>(), hash, input, correlationId);
|
|
|
|
|
|
|
|
|
|
public static StandardStimulus Standard<T>(string? hash, object input, string? correlationId = default) where T : IActivity =>
|
|
|
|
|
new(ActivityTypeNameHelper.GenerateTypeName<T>(), hash, input.ToDictionary(), correlationId);
|
|
|
|
|
|
|
|
|
|
public static StandardStimulus Standard<T>(object input, string? correlationId = default) where T : IActivity =>
|
|
|
|
|
new(ActivityTypeNameHelper.GenerateTypeName<T>(), default, input.ToDictionary(), correlationId);
|
|
|
|
|
|
2022-04-11 12:19:55 +00:00
|
|
|
public static StandardStimulus Standard(string activityTypeName, string? hash = default, IDictionary<string, object>? input = default, string? correlationId = default) => new(activityTypeName, hash, input, correlationId);
|
2022-08-10 14:02:53 +00:00
|
|
|
public static StandardStimulus Standard(string activityTypeName, string? hash, object? input, string? correlationId = default) => new(activityTypeName, hash, input?.ToDictionary(), correlationId);
|
|
|
|
|
public static StandardStimulus Standard(string activityTypeName, object? input, string? correlationId = default) => new(activityTypeName, default, input?.ToDictionary(), correlationId);
|
2022-01-04 08:42:12 +00:00
|
|
|
}
|