diff --git a/src/ServerlessWorkflow.Sdk.Builders/Interfaces/IRunTaskDefinitionBuilder.cs b/src/ServerlessWorkflow.Sdk.Builders/Interfaces/IRunTaskDefinitionBuilder.cs index 42d4d0f..ac4d4ff 100644 --- a/src/ServerlessWorkflow.Sdk.Builders/Interfaces/IRunTaskDefinitionBuilder.cs +++ b/src/ServerlessWorkflow.Sdk.Builders/Interfaces/IRunTaskDefinitionBuilder.cs @@ -44,4 +44,11 @@ public interface IRunTaskDefinitionBuilder /// A new IWorkflowProcessDefinitionBuilder Workflow(); + /// + /// Configures whether the task to build should await the execution of the defined process + /// + /// A boolean indicating whether or not the task to build should await the execution of the defined process + /// The configured + IRunTaskDefinitionBuilder Await(bool await); + } diff --git a/src/ServerlessWorkflow.Sdk.Builders/RunTaskDefinitionBuilder.cs b/src/ServerlessWorkflow.Sdk.Builders/RunTaskDefinitionBuilder.cs index a026ca8..9fa1b73 100644 --- a/src/ServerlessWorkflow.Sdk.Builders/RunTaskDefinitionBuilder.cs +++ b/src/ServerlessWorkflow.Sdk.Builders/RunTaskDefinitionBuilder.cs @@ -22,6 +22,11 @@ public class RunTaskDefinitionBuilder : TaskDefinitionBuilder, IRunTaskDefinitionBuilder { + /// + /// Gets/sets a boolean indicating whether or not the task to build should await the execution of the defined process + /// + protected bool? AwaitProcess { get; set; } + /// /// Gets/sets the process to run /// @@ -59,6 +64,13 @@ public virtual IWorkflowProcessDefinitionBuilder Workflow() return builder; } + /// + public virtual IRunTaskDefinitionBuilder Await(bool await) + { + this.AwaitProcess = await; + return this; + } + /// public override RunTaskDefinition Build() { @@ -71,7 +83,8 @@ public override RunTaskDefinition Build() Container = process is ContainerProcessDefinition container ? container : null, Script = process is ScriptProcessDefinition script ? script : null, Shell = process is ShellProcessDefinition shell ? shell : null, - Workflow = process is WorkflowProcessDefinition workflow ? workflow : null + Workflow = process is WorkflowProcessDefinition workflow ? workflow : null, + Await = this.AwaitProcess } }); } diff --git a/src/ServerlessWorkflow.Sdk.Builders/ServerlessWorkflow.Sdk.Builders.csproj b/src/ServerlessWorkflow.Sdk.Builders/ServerlessWorkflow.Sdk.Builders.csproj index 24ea486..42b5f6b 100644 --- a/src/ServerlessWorkflow.Sdk.Builders/ServerlessWorkflow.Sdk.Builders.csproj +++ b/src/ServerlessWorkflow.Sdk.Builders/ServerlessWorkflow.Sdk.Builders.csproj @@ -5,7 +5,7 @@ enable enable 1.0.0 - alpha5 + alpha5.1 $(VersionPrefix) $(VersionPrefix) en diff --git a/src/ServerlessWorkflow.Sdk.IO/ServerlessWorkflow.Sdk.IO.csproj b/src/ServerlessWorkflow.Sdk.IO/ServerlessWorkflow.Sdk.IO.csproj index 2e9bba6..746700b 100644 --- a/src/ServerlessWorkflow.Sdk.IO/ServerlessWorkflow.Sdk.IO.csproj +++ b/src/ServerlessWorkflow.Sdk.IO/ServerlessWorkflow.Sdk.IO.csproj @@ -5,7 +5,7 @@ enable enable 1.0.0 - alpha5 + alpha5.1 $(VersionPrefix) $(VersionPrefix) en diff --git a/src/ServerlessWorkflow.Sdk/Models/ProcessTypeDefinition.cs b/src/ServerlessWorkflow.Sdk/Models/ProcessTypeDefinition.cs index ef91f38..56b2c5f 100644 --- a/src/ServerlessWorkflow.Sdk/Models/ProcessTypeDefinition.cs +++ b/src/ServerlessWorkflow.Sdk/Models/ProcessTypeDefinition.cs @@ -46,6 +46,12 @@ public record ProcessTypeDefinition [DataMember(Name = "workflow", Order = 4), JsonPropertyName("workflow"), JsonPropertyOrder(4), YamlMember(Alias = "workflow", Order = 4)] public virtual WorkflowProcessDefinition? Workflow { get; set; } + /// + /// Gets/sets a boolean indicating whether or not to await the process completion before continuing. Defaults to 'true'. + /// + [DataMember(Name = "await", Order = 5), JsonPropertyName("await"), JsonPropertyOrder(5), YamlMember(Alias = "await", Order = 5)] + public virtual bool? Await { get; set; } + /// /// Gets the type of the defined process tasks /// diff --git a/src/ServerlessWorkflow.Sdk/ServerlessWorkflow.Sdk.csproj b/src/ServerlessWorkflow.Sdk/ServerlessWorkflow.Sdk.csproj index 8697ada..a2860e7 100644 --- a/src/ServerlessWorkflow.Sdk/ServerlessWorkflow.Sdk.csproj +++ b/src/ServerlessWorkflow.Sdk/ServerlessWorkflow.Sdk.csproj @@ -5,7 +5,7 @@ enable enable 1.0.0 - alpha5 + alpha5.1 $(VersionPrefix) $(VersionPrefix) en