Add Tag property
This commit is contained in:
parent
22e19545fe
commit
576a0e50e8
|
|
@ -13,24 +13,30 @@ namespace Elsa.Client.Models
|
|||
[DataMember(Order = 6)] public bool IsLatest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An initial set of variables available to workflow instances.
|
||||
/// Allows for applications to store an application-specific, queryable value to associate with the workflow.
|
||||
/// </summary>
|
||||
[DataMember(Order = 7)]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An initial set of variables available to workflow instances.
|
||||
/// </summary>
|
||||
[DataMember(Order = 8)]
|
||||
public Variables Variables { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// An optional context type around which this workflow revolves. For example, a document, a leave request or a job application.
|
||||
/// </summary>
|
||||
[DataMember(Order = 8)]
|
||||
[DataMember(Order = 9)]
|
||||
public WorkflowContextOptions? ContextOptions { get; set; }
|
||||
|
||||
[DataMember(Order = 9)] public WorkflowPersistenceBehavior PersistenceBehavior { get; set; }
|
||||
[DataMember(Order = 10)] public bool DeleteCompletedInstances { get; set; }
|
||||
[DataMember(Order = 10)] public WorkflowPersistenceBehavior PersistenceBehavior { get; set; }
|
||||
[DataMember(Order = 11)] public bool DeleteCompletedInstances { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A dictionary to store application-specific properties for a given workflow.
|
||||
/// </summary>
|
||||
[DataMember(Order = 11)]
|
||||
[DataMember(Order = 12)]
|
||||
public Variables CustomAttributes { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,14 @@ namespace Elsa.Client.Models
|
|||
[DataMember(Order = 12)] public bool DeleteCompletedInstances { get; set; }
|
||||
[DataMember(Order = 13)] public bool IsPublished { get; set; }
|
||||
[DataMember(Order = 14)] public bool IsLatest { get; set; }
|
||||
[DataMember(Order = 15)] public ICollection<ActivityDefinition> Activities { get; set; }
|
||||
[DataMember(Order = 16)] public ICollection<ConnectionDefinition> Connections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allows for applications to store an application-specific, queryable value to associate with the workflow.
|
||||
/// </summary>
|
||||
[DataMember(Order = 15)]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
[DataMember(Order = 16)] public ICollection<ActivityDefinition> Activities { get; set; }
|
||||
[DataMember(Order = 17)] public ICollection<ConnectionDefinition> Connections { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -29,6 +29,12 @@ namespace Elsa.Models
|
|||
public bool DeleteCompletedInstances { get; set; }
|
||||
public bool IsPublished { get; set; }
|
||||
public bool IsLatest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allows for applications to store an application-specific, queryable value to associate with the workflow.
|
||||
/// </summary>
|
||||
public string? Tag { get; set; }
|
||||
|
||||
public ICollection<ActivityDefinition> Activities { get; set; }
|
||||
public ICollection<ConnectionDefinition> Connections { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace Elsa.Persistence.EntityFramework.Core.Configuration
|
|||
builder.HasIndex(x => x.Name).HasDatabaseName($"IX_{nameof(WorkflowDefinition)}_{nameof(WorkflowDefinition.Name)}");
|
||||
builder.HasIndex(x => x.IsLatest).HasDatabaseName($"IX_{nameof(WorkflowDefinition)}_{nameof(WorkflowDefinition.IsLatest)}");
|
||||
builder.HasIndex(x => x.IsPublished).HasDatabaseName($"IX_{nameof(WorkflowDefinition)}_{nameof(WorkflowDefinition.IsPublished)}");
|
||||
builder.HasIndex(x => x.Tag).HasDatabaseName($"IX_{nameof(WorkflowDefinition)}_{nameof(WorkflowDefinition.Tag)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
||||
{
|
||||
[DbContext(typeof(ElsaContext))]
|
||||
[Migration("20210420081700_Initial")]
|
||||
[Migration("20210426080827_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
|
@ -112,6 +112,9 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
|
@ -129,6 +132,9 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
@ -41,6 +41,7 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
DeleteCompletedInstances = table.Column<bool>(type: "boolean", nullable: false),
|
||||
IsPublished = table.Column<bool>(type: "boolean", nullable: false),
|
||||
IsLatest = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Tag = table.Column<string>(type: "text", nullable: true),
|
||||
Data = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
|
|
@ -143,6 +144,11 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
table: "WorkflowDefinitions",
|
||||
column: "Name");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_Tag",
|
||||
table: "WorkflowDefinitions",
|
||||
column: "Tag");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_TenantId",
|
||||
table: "WorkflowDefinitions",
|
||||
|
|
@ -110,6 +110,9 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("text");
|
||||
|
||||
|
|
@ -127,6 +130,9 @@ namespace Elsa.Persistence.EntityFramework.PostgreSql.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
||||
{
|
||||
[DbContext(typeof(ElsaContext))]
|
||||
[Migration("20210420081809_Initial")]
|
||||
[Migration("20210426080934_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
|
@ -112,6 +112,9 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
|
|
@ -129,6 +132,9 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
@ -41,6 +41,7 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
DeleteCompletedInstances = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsPublished = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsLatest = table.Column<bool>(type: "bit", nullable: false),
|
||||
Tag = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Data = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
|
|
@ -143,6 +144,11 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
table: "WorkflowDefinitions",
|
||||
column: "Name");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_Tag",
|
||||
table: "WorkflowDefinitions",
|
||||
column: "Tag");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_TenantId",
|
||||
table: "WorkflowDefinitions",
|
||||
|
|
@ -110,6 +110,9 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
|
|
@ -127,6 +130,9 @@ namespace Elsa.Persistence.EntityFramework.SqlServer.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
||||
{
|
||||
[DbContext(typeof(ElsaContext))]
|
||||
[Migration("20210420081738_Initial")]
|
||||
[Migration("20210426080912_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
|
@ -109,6 +109,9 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
|
@ -126,6 +129,9 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
@ -41,6 +41,7 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
DeleteCompletedInstances = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
IsPublished = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
IsLatest = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Tag = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Data = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
|
|
@ -143,6 +144,11 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
table: "WorkflowDefinitions",
|
||||
column: "Name");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_Tag",
|
||||
table: "WorkflowDefinitions",
|
||||
column: "Tag");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkflowDefinition_TenantId",
|
||||
table: "WorkflowDefinitions",
|
||||
|
|
@ -107,6 +107,9 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
b.Property<int>("PersistenceBehavior")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Tag")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TenantId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
|
@ -124,6 +127,9 @@ namespace Elsa.Persistence.EntityFramework.Sqlite.Migrations
|
|||
b.HasIndex("Name")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Name");
|
||||
|
||||
b.HasIndex("Tag")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_Tag");
|
||||
|
||||
b.HasIndex("TenantId")
|
||||
.HasDatabaseName("IX_WorkflowDefinition_TenantId");
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,9 @@ namespace Elsa.Persistence.MongoDb.Services
|
|||
var definitionIdKeysDefinition = Builders<WorkflowDefinition>.IndexKeys.Ascending(x => x.DefinitionId);
|
||||
var versionKeysDefinition = Builders<WorkflowDefinition>.IndexKeys.Ascending(x => x.Version);
|
||||
var nameKeysDefinition = Builders<WorkflowDefinition>.IndexKeys.Ascending(x => x.Name);
|
||||
var tagKeysDefinition = Builders<WorkflowDefinition>.IndexKeys.Ascending(x => x.Tag);
|
||||
|
||||
await CreateIndexesAsync(_mongoContext.WorkflowDefinitions, cancellationToken, tenantKeysDefinition, definitionIdKeysDefinition, versionKeysDefinition, nameKeysDefinition);
|
||||
await CreateIndexesAsync(_mongoContext.WorkflowDefinitions, cancellationToken, tenantKeysDefinition, definitionIdKeysDefinition, versionKeysDefinition, nameKeysDefinition, tagKeysDefinition);
|
||||
}
|
||||
|
||||
private async Task CreateWorkflowExecutionLogIndexes(CancellationToken cancellationToken)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace Elsa.Persistence.YesSql.Documents
|
|||
public bool DeleteCompletedInstances { get; set; }
|
||||
public bool IsPublished { get; set; }
|
||||
public bool IsLatest { get; set; }
|
||||
public string? Tag { get; set; }
|
||||
public ICollection<ActivityDefinition> Activities { get; set; } = new List<ActivityDefinition>();
|
||||
public ICollection<ConnectionDefinition> Connections { get; set; } = new List<ConnectionDefinition>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ namespace Elsa.Persistence.YesSql.Indexes
|
|||
public int Version { get; set; }
|
||||
public bool IsLatest { get; set; }
|
||||
public bool IsPublished { get; set; }
|
||||
public string? Tag { get; set; }
|
||||
}
|
||||
|
||||
public class WorkflowDefinitionIndexProvider : IndexProvider<WorkflowDefinitionDocument>
|
||||
|
|
@ -29,7 +30,8 @@ namespace Elsa.Persistence.YesSql.Indexes
|
|||
DefinitionVersionId = workflowDefinition.DefinitionVersionId,
|
||||
Version = workflowDefinition.Version,
|
||||
IsPublished = workflowDefinition.IsPublished,
|
||||
IsLatest = workflowDefinition.IsLatest
|
||||
IsLatest = workflowDefinition.IsLatest,
|
||||
Tag = workflowDefinition.Tag
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ namespace Elsa.Persistence.YesSql
|
|||
.Column<string>(nameof(WorkflowDefinitionIndex.DefinitionVersionId))
|
||||
.Column<int>(nameof(WorkflowDefinitionIndex.Version))
|
||||
.Column<bool>(nameof(WorkflowDefinitionIndex.IsLatest))
|
||||
.Column<bool>(nameof(WorkflowDefinitionIndex.IsPublished)),
|
||||
.Column<bool>(nameof(WorkflowDefinitionIndex.IsPublished))
|
||||
.Column<string>(nameof(WorkflowDefinitionIndex.Tag)),
|
||||
CollectionNames.WorkflowDefinitions);
|
||||
|
||||
SchemaBuilder.CreateMapIndexTable<WorkflowInstanceIndex>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue