Skip to content

Commit

Permalink
Feature/cancel dispatched workflows (#5136)
Browse files Browse the repository at this point in the history
* Made cancel API call dispatch the request

* Added ParentWorkflowInstanceId

* Recursively cancel child workflows

* Made single workflow cancellation include child workflows

* Updated migrations

* Processed comments
  • Loading branch information
raymonddenhaan committed Mar 27, 2024
1 parent b7991fd commit 4b151ff
Show file tree
Hide file tree
Showing 95 changed files with 299 additions and 2,041 deletions.
1 change: 1 addition & 0 deletions src/modules/Elsa.Common/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ public static Page<T> Paginate<T>(this IEnumerable<T> enumerable, PageArgs? page
/// <typeparam name="T">The type of the items in the lists.</typeparam>
/// <returns>True if the lists are equal, otherwise false.</returns>
public static bool IsEqualTo<T>(this IEnumerable<T> list1, IEnumerable<T> list2) => list1.OrderBy(g => g).SequenceEqual(list2.OrderBy(g => g));

}
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private void ApplyFilter(ParameterizedQuery query, WorkflowInstanceFilter filter
.In(nameof(WorkflowInstance.DefinitionId), filter.DefinitionIds)
.Is(nameof(WorkflowInstance.DefinitionVersionId), filter.DefinitionVersionId)
.In(nameof(WorkflowInstance.DefinitionVersionId), filter.DefinitionVersionIds)
.In(nameof(WorkflowInstance.ParentWorkflowInstanceId), filter.ParentWorkflowInstanceIds)
.Is(nameof(WorkflowInstance.Status), filter.WorkflowStatus?.ToString())
.Is(nameof(WorkflowInstance.SubStatus), filter.WorkflowSubStatus?.ToString())
.Is(nameof(WorkflowInstance.Name), filter.Version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private static QueryDescriptor<WorkflowInstance> Filter(QueryDescriptor<Workflow
// TODO: filter by IDs
// TODO: filter by DefinitionIDs
// TODO: filter by DefinitionVersionIDs
// TODO: filter by ParentWorkflowInstanceIds
// TODO: filter by CorrelationIDs
// TODO: filter by WorkflowStatuses
// TODO: filter by WorkflowSubStatuses
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ protected override void Up(MigrationBuilder migrationBuilder)
nullable: false,
defaultValue: false);

migrationBuilder.AddColumn<string>(
name: "ParentWorkflowInstanceId",
schema: "Elsa",
table: "WorkflowInstances",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");

migrationBuilder.AddColumn<bool>(
name: "IsSystem",
schema: "Elsa",
Expand Down Expand Up @@ -70,6 +78,11 @@ protected override void Down(MigrationBuilder migrationBuilder)
schema: "Elsa",
table: "WorkflowInstances");

migrationBuilder.DropColumn(
name: "ParentWorkflowInstanceId",
schema: "Elsa",
table: "WorkflowInstances");

migrationBuilder.DropColumn(
name: "IsSystem",
schema: "Elsa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("Name")
.HasColumnType("varchar(255)");
b.Property<string>("ParentWorkflowInstanceId")
.HasColumnType("longtext");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("varchar(255)");
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b151ff

Please sign in to comment.