Add ToolVersion field to workflow definition

This commit is contained in:
Sipke Schoorstra 2023-07-06 18:06:18 +02:00
parent 0eea344406
commit 49da22fb8e
5 changed files with 26 additions and 1 deletions

View file

@ -3,7 +3,7 @@ using Elsa.Api.Client.Extensions;
namespace Elsa.Api.Client.Activities;
/// <summary>
/// Represents an activity in a workflow definition.
/// Represents an activity.
/// </summary>
public class Activity : Dictionary<string, object>
{
@ -15,6 +15,15 @@ public class Activity : Dictionary<string, object>
get => this.TryGetValue<string>("id")!;
set => this["id"] = value;
}
/// <summary>
/// Gets or sets the name of this activity.
/// </summary>
public string? Name
{
get => this.TryGetValue<string>("name")!;
set => this["name"] = value!;
}
/// <summary>
/// Gets or sets the type of this activity.

View file

@ -30,6 +30,7 @@ public record WorkflowDefinitionModel(
string? Description,
DateTimeOffset CreatedAt,
int Version,
Version? ToolVersion,
ICollection<VariableDefinition>? Variables,
ICollection<InputDefinition>? Inputs,
ICollection<OutputDefinition>? Outputs,
@ -59,6 +60,7 @@ public record WorkflowDefinitionModel(
default!,
default!,
default!,
default!,
default!)
{
}

View file

@ -13,6 +13,11 @@ public interface IActivity
/// </summary>
string Id { get; set; }
/// <summary>
/// An optional name by which the activity can be referenced.
/// </summary>
string? Name { get; set; }
/// <summary>
/// The logical type name of the activity.
/// </summary>

View file

@ -35,6 +35,9 @@ public abstract class Activity : IActivity, ISignalHandler
/// <inheritdoc />
public string Id { get; set; } = default!;
/// <inheritdoc />
public string? Name { get; set; }
/// <inheritdoc />
public string Type { get; set; }

View file

@ -19,6 +19,7 @@ public class WorkflowDefinitionSummary
Name = workflowDefinition.Name,
Description = workflowDefinition.Description,
Version = workflowDefinition.Version,
ToolVersion = workflowDefinition.ToolVersion,
IsLatest = workflowDefinition.IsLatest,
IsPublished = workflowDefinition.IsPublished,
ProviderName = workflowDefinition.ProviderName,
@ -51,6 +52,11 @@ public class WorkflowDefinitionSummary
/// </summary>
public int? Version { get; set; }
/// <summary>
/// The version of the tool that created the workflow definition.
/// </summary>
public Version? ToolVersion { get; set; }
/// <summary>
/// Whether this is the latest version of the workflow definition.
/// </summary>