From 7f0b3cb8fcaf192b1b5b063e6f3d2cd3ce32c436 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 14 Sep 2023 16:30:18 +0200 Subject: [PATCH] Fix cascaded handling of SetOutcome --- .../Elsa.Testing.Shared.csproj | 1 + .../TestApplicationBuilder.cs | 26 +- .../Activities/Complete.cs | 3 +- .../WorkflowDefinitionActivity.cs | 4 + .../Elsa.IntegrationTests.csproj | 10 + .../CompositesAndOutcomeWaitAnyTests.cs | 41 +++ .../Workflows/completor.json | 71 +++++ .../Workflows/consumer.json | 62 ++++ .../Workflows/tester.json | 145 +++++++++ .../Scenarios/DependencyWorkflows/Tests.cs | 7 +- .../ExplicitJoins/ExplicitJoinWaitAnyTests.cs | 8 +- .../ExplicitJoins/Workflows/join-all-1.json | 249 ++++++++++++++- .../ExplicitJoins/Workflows/join-all-2.json | 288 +++++++++++++++++- 13 files changed, 898 insertions(+), 17 deletions(-) create mode 100644 test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/CompositesAndOutcomeWaitAnyTests.cs create mode 100644 test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/completor.json create mode 100644 test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/consumer.json create mode 100644 test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/tester.json diff --git a/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj b/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj index aa375fc42..afab452e4 100644 --- a/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj +++ b/src/common/Elsa.Testing.Shared/Elsa.Testing.Shared.csproj @@ -20,6 +20,7 @@ + diff --git a/src/common/Elsa.Testing.Shared/TestApplicationBuilder.cs b/src/common/Elsa.Testing.Shared/TestApplicationBuilder.cs index 2a2c92c36..9b823c071 100644 --- a/src/common/Elsa.Testing.Shared/TestApplicationBuilder.cs +++ b/src/common/Elsa.Testing.Shared/TestApplicationBuilder.cs @@ -3,6 +3,7 @@ using Elsa.Features.Services; using Elsa.Workflows.Core.Activities; using Elsa.Workflows.Core.Contracts; using Elsa.Workflows.Core.Services; +using FluentStorage; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -32,7 +33,7 @@ public class TestApplicationBuilder .AddSingleton(testOutputHelper) .AddSingleton() .AddLogging(logging => logging.AddProvider(new XunitLoggerProvider(testOutputHelper)).SetMinimumLevel(LogLevel.Debug)); - + _configureElsa += elsa => elsa .AddActivitiesFrom() .UseScheduling() @@ -40,7 +41,6 @@ public class TestApplicationBuilder .UseLiquid() .UseDsl() .UseWorkflowManagement() - .UseWorkflows(workflows => workflows .WithStandardOutStreamProvider(_ => new StandardOutStreamProvider(new XunitConsoleTextWriter(_testOutputHelper))) ); @@ -66,7 +66,7 @@ public class TestApplicationBuilder _configureElsa += configure; return this; } - + /// /// Configures the service provider. /// @@ -95,8 +95,26 @@ public class TestApplicationBuilder /// /// Adds a workflow to the service provider. /// - public TestApplicationBuilder AddWorkflow() where T:IWorkflow + public TestApplicationBuilder AddWorkflow() where T : IWorkflow { return ConfigureElsa(elsa => elsa.AddWorkflow()); } + + /// + /// Add workflows from the specified relative directory. + /// + /// The path segments of the directory. + public TestApplicationBuilder WithWorkflowsFromDirectory(params string[] directory) + { + var assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location; + var assemblyDirectory = Path.GetDirectoryName(assemblyLocation)!; + var workflowsDirectory = directory.Prepend(assemblyDirectory).ToArray(); + _configureElsa += elsa => elsa.UseFluentStorageProvider(storage => storage.BlobStorage = sp => StorageFactory.Blobs.DirectoryFiles(Path.Combine(workflowsDirectory))); + return this; + } + + private static string GetWorkflowsDirectory() + { + return Path.Combine("Scenarios", "DependencyWorkflows", "Workflows"); + } } \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Core/Activities/Complete.cs b/src/modules/Elsa.Workflows.Core/Activities/Complete.cs index 910ecea4b..c5e477a77 100644 --- a/src/modules/Elsa.Workflows.Core/Activities/Complete.cs +++ b/src/modules/Elsa.Workflows.Core/Activities/Complete.cs @@ -63,8 +63,7 @@ public class Complete : Activity var outcomes = InterpretOutcomes(outcomesValue).ToArray(); await context.SendSignalAsync(new CompleteCompositeSignal(new Outcomes(outcomes))); - - // Don't complete this activity, as it will be completed by the composite activity. + await context.CompleteActivityAsync(); } private static IEnumerable InterpretOutcomes(object? outcomesValue) diff --git a/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivity.cs b/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivity.cs index 98ddaf822..bcbc70bac 100644 --- a/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivity.cs +++ b/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivity.cs @@ -119,6 +119,10 @@ public class WorkflowDefinitionActivity : Composite, IInitializable // Do we have a "complete composite" signal that triggered the completion? var completeCompositeSignal = context.WorkflowExecutionContext.TransientProperties.TryGetValue(nameof(CompleteCompositeSignal), out var signal) ? (CompleteCompositeSignal)signal : default; + // If we do, make sure to remove it from the transient properties. + if (completeCompositeSignal != null) + context.WorkflowExecutionContext.TransientProperties.Remove(nameof(CompleteCompositeSignal)); + await targetContext.CompleteActivityAsync(completeCompositeSignal?.Value); } diff --git a/test/integration/Elsa.IntegrationTests/Elsa.IntegrationTests.csproj b/test/integration/Elsa.IntegrationTests/Elsa.IntegrationTests.csproj index 413201fa9..fea91ccf7 100644 --- a/test/integration/Elsa.IntegrationTests/Elsa.IntegrationTests.csproj +++ b/test/integration/Elsa.IntegrationTests/Elsa.IntegrationTests.csproj @@ -108,6 +108,15 @@ Always + + Always + + + Always + + + Always + @@ -118,4 +127,5 @@ + diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/CompositesAndOutcomeWaitAnyTests.cs b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/CompositesAndOutcomeWaitAnyTests.cs new file mode 100644 index 000000000..af95fa39f --- /dev/null +++ b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/CompositesAndOutcomeWaitAnyTests.cs @@ -0,0 +1,41 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Elsa.Testing.Shared; +using Elsa.Workflows.Core; +using Xunit; +using Xunit.Abstractions; + +namespace Elsa.IntegrationTests.Scenarios.CompositesAndOutcomes; + +public class ExplicitJoinWaitAnyTests +{ + private readonly CapturingTextWriter _capturingTextWriter = new(); + private readonly IServiceProvider _services; + + public ExplicitJoinWaitAnyTests(ITestOutputHelper testOutputHelper) + { + _services = new TestApplicationBuilder(testOutputHelper) + .WithCapturingTextWriter(_capturingTextWriter) + .WithWorkflowsFromDirectory("Scenarios", "CompositesAndOutcomes", "Workflows") + .Build(); + } + + [Fact(DisplayName = "Complete activity must not cascade.")] + public async Task Test1() + { + // Populate registries. + await _services.PopulateRegistriesAsync(); + + // Execute. + var workflowState = await _services.RunWorkflowUntilEndAsync("tester"); + + // Assert expected output. + var lines = _capturingTextWriter.Lines.ToList(); + var expectedLinesArray = new[] { "Start", "End" }; + Assert.Equal(expectedLinesArray, lines); + + // Assert expected workflow status. + Assert.Equal(WorkflowStatus.Finished, workflowState.Status); + } +} \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/completor.json b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/completor.json new file mode 100644 index 000000000..61b1c1e85 --- /dev/null +++ b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/completor.json @@ -0,0 +1,71 @@ +{ + "id": "3457460b3fd74daa8f898564cf96fe48", + "definitionId": "99c1c6cf2fec47b3b4916a01425ec989", + "name": "Completor", + "createdAt": "2023-09-14T13:49:38.017111+00:00", + "version": 1, + "toolVersion": "3.0.0.0", + "variables": [], + "inputs": [], + "outputs": [], + "outcomes": [ + "Success", + "Failure" + ], + "customProperties": {}, + "isReadonly": false, + "isLatest": true, + "isPublished": true, + "options": { + "usableAsActivity": true, + "autoUpdateConsumingWorkflows": true, + "activityCategory": "Testing" + }, + "root": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "Gn-5gEC2-UCmmzWTgvYCmw", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "outcomes": { + "typeName": "Object", + "expression": { + "type": "Literal", + "value": "Success" + }, + "memoryReference": { + "id": "tyDvLNGiYkCbUabhgzcSdw:input-0" + } + }, + "id": "tyDvLNGiYkCbUabhgzcSdw", + "name": "Complete1", + "type": "Elsa.Complete", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -186.5, + "y": -263 + }, + "size": { + "width": 136.8125, + "height": 50 + } + } + } + } + ], + "connections": [] + } +} \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/consumer.json b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/consumer.json new file mode 100644 index 000000000..cc055a8e4 --- /dev/null +++ b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/consumer.json @@ -0,0 +1,62 @@ +{ + "id": "9b6b4d4a6a8741c58ccbe3911eed7821", + "definitionId": "bc7f148b2a5b4f55811537a0d762e137", + "name": "Consumer", + "createdAt": "2023-09-14T13:50:13.31251+00:00", + "version": 1, + "toolVersion": "3.0.0.0", + "variables": [], + "inputs": [], + "outputs": [], + "outcomes": [], + "customProperties": {}, + "isReadonly": false, + "isLatest": true, + "isPublished": true, + "options": { + "usableAsActivity": true, + "autoUpdateConsumingWorkflows": true, + "activityCategory": "Testing" + }, + "root": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "v-ii0Vp0yUCPWReLNUiosg", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "workflowDefinitionId": "99c1c6cf2fec47b3b4916a01425ec989", + "workflowDefinitionVersionId": "3457460b3fd74daa8f898564cf96fe48", + "latestAvailablePublishedVersion": 1, + "latestAvailablePublishedVersionId": "3457460b3fd74daa8f898564cf96fe48", + "id": "ctusr1Uv40uFqIws9Ymt9A", + "name": "Completor1", + "type": "Completor", + "version": 2, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 20, + "y": -260 + }, + "size": { + "width": 106.859375, + "height": 116.015625 + } + } + } + } + ], + "connections": [] + } +} \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/tester.json b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/tester.json new file mode 100644 index 000000000..60e381d9a --- /dev/null +++ b/test/integration/Elsa.IntegrationTests/Scenarios/CompositesAndOutcomes/Workflows/tester.json @@ -0,0 +1,145 @@ +{ + "id": "74144d614208497380a7bae783b78626", + "definitionId": "tester", + "name": "Tester", + "createdAt": "2023-09-14T13:50:38.720025+00:00", + "version": 1, + "toolVersion": "3.0.0.0", + "variables": [], + "inputs": [], + "outputs": [], + "outcomes": [], + "customProperties": {}, + "isReadonly": false, + "isLatest": true, + "isPublished": true, + "options": { + "autoUpdateConsumingWorkflows": false + }, + "root": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "k0HQeDE_gk-OxcsjGj3tbQ", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Start" + }, + "memoryReference": { + "id": "35MeNlWlAUKXd5JFDJtJ3w:input-0" + } + }, + "id": "35MeNlWlAUKXd5JFDJtJ3w", + "name": "WriteLine1", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -198, + "y": -246.9921875 + }, + "size": { + "width": 139.296875, + "height": 50 + } + } + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "End" + }, + "memoryReference": { + "id": "CvdSrKs5DESezhkLjb0YIw:input-0" + } + }, + "id": "CvdSrKs5DESezhkLjb0YIw", + "name": "WriteLine2", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 253, + "y": -246.9921875 + }, + "size": { + "width": 139.296875, + "height": 50 + } + } + } + }, + { + "workflowDefinitionId": "bc7f148b2a5b4f55811537a0d762e137", + "workflowDefinitionVersionId": "9b6b4d4a6a8741c58ccbe3911eed7821", + "latestAvailablePublishedVersion": 1, + "latestAvailablePublishedVersionId": "9b6b4d4a6a8741c58ccbe3911eed7821", + "id": "QfkYnRZDxEO0rtBTIbTXzg", + "name": "Consumer1", + "type": "Consumer", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 20, + "y": -280 + }, + "size": { + "width": 105.5625, + "height": 116.015625 + } + } + } + } + ], + "connections": [ + { + "source": { + "activity": "35MeNlWlAUKXd5JFDJtJ3w", + "port": "Done" + }, + "target": { + "activity": "QfkYnRZDxEO0rtBTIbTXzg", + "port": "In" + } + }, + { + "source": { + "activity": "QfkYnRZDxEO0rtBTIbTXzg", + "port": "Done" + }, + "target": { + "activity": "CvdSrKs5DESezhkLjb0YIw", + "port": "In" + } + } + ] + } +} \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/DependencyWorkflows/Tests.cs b/test/integration/Elsa.IntegrationTests/Scenarios/DependencyWorkflows/Tests.cs index 5214b9dc0..8011d97d7 100644 --- a/test/integration/Elsa.IntegrationTests/Scenarios/DependencyWorkflows/Tests.cs +++ b/test/integration/Elsa.IntegrationTests/Scenarios/DependencyWorkflows/Tests.cs @@ -19,7 +19,7 @@ public class Tests { _services = new TestApplicationBuilder(testOutputHelper) .WithCapturingTextWriter(_capturingTextWriter) - .ConfigureElsa(elsa => elsa.UseFluentStorageProvider(storage => storage.BlobStorage = sp => StorageFactory.Blobs.DirectoryFiles(GetWorkflowsDirectory()))) + .WithWorkflowsFromDirectory("Scenarios", "DependencyWorkflows", "Workflows") .Build(); } @@ -37,9 +37,4 @@ public class Tests Assert.Equal(new[] { "Atom", "Atom", "Atom", "Atom", "Atom", "Atom", "Atom", "Atom", "Atom" }, lines); } - - private static string GetWorkflowsDirectory() - { - return Path.Combine("Scenarios", "DependencyWorkflows", "Workflows"); - } } \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/ExplicitJoinWaitAnyTests.cs b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/ExplicitJoinWaitAnyTests.cs index 17f2754f2..b9995a091 100644 --- a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/ExplicitJoinWaitAnyTests.cs +++ b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/ExplicitJoinWaitAnyTests.cs @@ -15,20 +15,22 @@ public class ExplicitJoinWaitAnyTests public ExplicitJoinWaitAnyTests(ITestOutputHelper testOutputHelper) { - _services = new TestApplicationBuilder(testOutputHelper).WithCapturingTextWriter(_capturingTextWriter).Build(); + _services = new TestApplicationBuilder(testOutputHelper) + .WithCapturingTextWriter(_capturingTextWriter) + .Build(); } [Theory(DisplayName = "Workflows with explicit joins complete the workflow.")] [InlineData("join-any-1.json", "Start; End")] [InlineData("join-all-1.json", "Start; Line 1; Line 2; End")] [InlineData("join-all-2.json", "Start; Line 1; Line 2; End")] - public async Task Test1(string workflowFileName, string expectedLines) + public async Task Test1(string filename, string expectedLines) { // Populate registries. await _services.PopulateRegistriesAsync(); // Import workflow. - var fileName = $"Scenarios/ExplicitJoins/Workflows/{workflowFileName}"; + var fileName = $"Scenarios/ExplicitJoins/Workflows/{filename}"; var workflowDefinition = await _services.ImportWorkflowDefinitionAsync(fileName); // Execute. diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-1.json b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-1.json index fd1fb2847..04dd4e89c 100644 --- a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-1.json +++ b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-1.json @@ -1 +1,248 @@ -{"id":"9948e541b0e540c384c6eb9fdcf1d544","definitionId":"296428cc22bd4f309e858f4b461dbb3d","name":"Join 1","createdAt":"2023-09-12T18:12:54.370149+00:00","version":2,"toolVersion":"3.0.0.0","variables":[],"inputs":[],"outputs":[],"outcomes":[],"customProperties":{},"isReadonly":false,"isLatest":true,"isPublished":true,"options":{"autoUpdateConsumingWorkflows":false},"root":{"type":"Elsa.Flowchart","version":1,"id":"sL581qWiIEOpRncv5Ez33A","metadata":{},"customProperties":{"source":"FlowchartJsonConverter.cs:46","notFoundConnections":[],"canStartWorkflow":false,"runAsynchronously":false},"activities":[{"mode":{"typeName":"Elsa.Workflows.Core.Activities.Flowchart.Models.FlowJoinMode, Elsa.Workflows.Core","expression":{"type":"Literal","value":"WaitAll"},"memoryReference":{"id":"aA4pfJOzyEqmLOY3U3vCoQ:input-0"}},"id":"aA4pfJOzyEqmLOY3U3vCoQ","name":"FlowJoin1","type":"Elsa.FlowJoin","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":198,"y":-266},"size":{"width":136.859375,"height":50}}}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"Start"},"memoryReference":{"id":"FRXh0PlHekejZiWANAplUg:input-0"}},"id":"FRXh0PlHekejZiWANAplUg","name":"WriteLine1","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-287,"y":-266},"size":{"width":102.21875,"height":50}},"displayText":"Start"}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"Line 1"},"memoryReference":{"id":"GaVrCWqBDkS6YrvydxKvFA:input-0"}},"id":"GaVrCWqBDkS6YrvydxKvFA","name":"WriteLine2","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-40,"y":-316},"size":{"width":110.65625,"height":50}},"displayText":"Line 1"}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"Line 2"},"memoryReference":{"id":"9Z7bt98j00uRMt9TS2FD0g:input-0"}},"id":"9Z7bt98j00uRMt9TS2FD0g","name":"WriteLine3","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-40,"y":-207},"size":{"width":110.65625,"height":50}},"displayText":"Line 2"}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"End"},"memoryReference":{"id":"MplDrS_bUE-8td-XBUvWmA:input-0"}},"id":"MplDrS_bUE-8td-XBUvWmA","name":"WriteLine4","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":430,"y":-266},"size":{"width":139.296875,"height":50}}}}],"connections":[{"source":{"activity":"FRXh0PlHekejZiWANAplUg","port":"Done"},"target":{"activity":"GaVrCWqBDkS6YrvydxKvFA","port":"In"}},{"source":{"activity":"FRXh0PlHekejZiWANAplUg","port":"Done"},"target":{"activity":"9Z7bt98j00uRMt9TS2FD0g","port":"In"}},{"source":{"activity":"9Z7bt98j00uRMt9TS2FD0g","port":"Done"},"target":{"activity":"aA4pfJOzyEqmLOY3U3vCoQ","port":"In"}},{"source":{"activity":"GaVrCWqBDkS6YrvydxKvFA","port":"Done"},"target":{"activity":"aA4pfJOzyEqmLOY3U3vCoQ","port":"In"}},{"source":{"activity":"aA4pfJOzyEqmLOY3U3vCoQ","port":"Done"},"target":{"activity":"MplDrS_bUE-8td-XBUvWmA","port":"In"}}]}} \ No newline at end of file +{ + "id": "9948e541b0e540c384c6eb9fdcf1d544", + "definitionId": "296428cc22bd4f309e858f4b461dbb3d", + "name": "Join 1", + "createdAt": "2023-09-12T18:12:54.370149+00:00", + "version": 2, + "toolVersion": "3.0.0.0", + "variables": [], + "inputs": [], + "outputs": [], + "outcomes": [], + "customProperties": {}, + "isReadonly": false, + "isLatest": true, + "isPublished": true, + "options": { + "autoUpdateConsumingWorkflows": false + }, + "root": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "sL581qWiIEOpRncv5Ez33A", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "mode": { + "typeName": "Elsa.Workflows.Core.Activities.Flowchart.Models.FlowJoinMode, Elsa.Workflows.Core", + "expression": { + "type": "Literal", + "value": "WaitAll" + }, + "memoryReference": { + "id": "aA4pfJOzyEqmLOY3U3vCoQ:input-0" + } + }, + "id": "aA4pfJOzyEqmLOY3U3vCoQ", + "name": "FlowJoin1", + "type": "Elsa.FlowJoin", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 198, + "y": -266 + }, + "size": { + "width": 136.859375, + "height": 50 + } + } + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Start" + }, + "memoryReference": { + "id": "FRXh0PlHekejZiWANAplUg:input-0" + } + }, + "id": "FRXh0PlHekejZiWANAplUg", + "name": "WriteLine1", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -287, + "y": -266 + }, + "size": { + "width": 102.21875, + "height": 50 + } + }, + "displayText": "Start" + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Line 1" + }, + "memoryReference": { + "id": "GaVrCWqBDkS6YrvydxKvFA:input-0" + } + }, + "id": "GaVrCWqBDkS6YrvydxKvFA", + "name": "WriteLine2", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -40, + "y": -316 + }, + "size": { + "width": 110.65625, + "height": 50 + } + }, + "displayText": "Line 1" + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Line 2" + }, + "memoryReference": { + "id": "9Z7bt98j00uRMt9TS2FD0g:input-0" + } + }, + "id": "9Z7bt98j00uRMt9TS2FD0g", + "name": "WriteLine3", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -40, + "y": -207 + }, + "size": { + "width": 110.65625, + "height": 50 + } + }, + "displayText": "Line 2" + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "End" + }, + "memoryReference": { + "id": "MplDrS_bUE-8td-XBUvWmA:input-0" + } + }, + "id": "MplDrS_bUE-8td-XBUvWmA", + "name": "WriteLine4", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 430, + "y": -266 + }, + "size": { + "width": 139.296875, + "height": 50 + } + } + } + } + ], + "connections": [ + { + "source": { + "activity": "FRXh0PlHekejZiWANAplUg", + "port": "Done" + }, + "target": { + "activity": "GaVrCWqBDkS6YrvydxKvFA", + "port": "In" + } + }, + { + "source": { + "activity": "FRXh0PlHekejZiWANAplUg", + "port": "Done" + }, + "target": { + "activity": "9Z7bt98j00uRMt9TS2FD0g", + "port": "In" + } + }, + { + "source": { + "activity": "9Z7bt98j00uRMt9TS2FD0g", + "port": "Done" + }, + "target": { + "activity": "aA4pfJOzyEqmLOY3U3vCoQ", + "port": "In" + } + }, + { + "source": { + "activity": "GaVrCWqBDkS6YrvydxKvFA", + "port": "Done" + }, + "target": { + "activity": "aA4pfJOzyEqmLOY3U3vCoQ", + "port": "In" + } + }, + { + "source": { + "activity": "aA4pfJOzyEqmLOY3U3vCoQ", + "port": "Done" + }, + "target": { + "activity": "MplDrS_bUE-8td-XBUvWmA", + "port": "In" + } + } + ] + } +} \ No newline at end of file diff --git a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-2.json b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-2.json index de848a14d..1bd4a139b 100644 --- a/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-2.json +++ b/test/integration/Elsa.IntegrationTests/Scenarios/ExplicitJoins/Workflows/join-all-2.json @@ -1 +1,287 @@ -{"id":"14984c048db34cceaf5e15ece80f9703","definitionId":"64f8f2c852f04dc28f60707034d7a906","name":"Join 2","createdAt":"2023-09-12T18:12:43.392272+00:00","version":1,"toolVersion":"3.0.0.0","variables":[],"inputs":[],"outputs":[],"outcomes":[],"customProperties":{},"isReadonly":false,"isLatest":true,"isPublished":true,"options":{"autoUpdateConsumingWorkflows":false},"root":{"type":"Elsa.Flowchart","version":1,"id":"B2jpPDriPEe-zSOhVuAGeQ","metadata":{},"customProperties":{"source":"FlowchartJsonConverter.cs:46","notFoundConnections":[],"canStartWorkflow":false,"runAsynchronously":false},"activities":[{"text":{"typeName":"String","expression":{"type":"Literal","value":"Start"},"memoryReference":{"id":"2yPLgUudQEGPaschdLdkGg:input-0"}},"id":"2yPLgUudQEGPaschdLdkGg","name":"WriteLine1","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-358.5,"y":-229},"size":{"width":139.296875,"height":50}},"displayText":"Start"}},{"body":{"type":"Elsa.Flowchart","version":1,"id":"zaAIlUtQDEaPqeITeRJ4_w","metadata":{},"customProperties":{"source":"FlowchartJsonConverter.cs:46","notFoundConnections":[],"canStartWorkflow":false,"runAsynchronously":false},"activities":[{"text":{"typeName":"String","expression":{"type":"Literal","value":"Line 2"},"memoryReference":{"id":"g3jVTdvU3EK7V5JqRqfqjQ:input-0"}},"id":"g3jVTdvU3EK7V5JqRqfqjQ","name":"WriteLine1","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-279.5,"y":-294},"size":{"width":139.296875,"height":50}},"displayText":"Line 2"}}],"connections":[]},"id":"eHAEEQ-Iu0GwM3mRxZin0Q","name":"FlowNode1","type":"Elsa.FlowNode","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-120,"y":-179},"size":{"width":211.15625,"height":120}},"displayText":"Line 2"}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"Line 1"},"memoryReference":{"id":"7RQ2sbVHo0SxsyK0dvTKEA:input-0"}},"id":"7RQ2sbVHo0SxsyK0dvTKEA","name":"WriteLine2","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":-120,"y":-279},"size":{"width":139.296875,"height":50}},"displayText":"Line 1"}},{"mode":{"typeName":"Elsa.Workflows.Core.Activities.Flowchart.Models.FlowJoinMode, Elsa.Workflows.Core","expression":{"type":"Literal","value":"WaitAll"},"memoryReference":{"id":"dVUuwMm5XUiYpiYoGo5JKA:input-0"}},"id":"dVUuwMm5XUiYpiYoGo5JKA","name":"FlowJoin1","type":"Elsa.FlowJoin","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":180.5,"y":-229},"size":{"width":136.859375,"height":50}}}},{"text":{"typeName":"String","expression":{"type":"Literal","value":"End"},"memoryReference":{"id":"NpZ_yT_irUuE9ASEfYLxbw:input-0"}},"id":"NpZ_yT_irUuE9ASEfYLxbw","name":"WriteLine3","type":"Elsa.WriteLine","version":1,"customProperties":{"canStartWorkflow":false,"runAsynchronously":false},"metadata":{"designer":{"position":{"x":400,"y":-229},"size":{"width":139.296875,"height":50}},"displayText":"End"}}],"connections":[{"source":{"activity":"2yPLgUudQEGPaschdLdkGg","port":"Done"},"target":{"activity":"7RQ2sbVHo0SxsyK0dvTKEA","port":"In"}},{"source":{"activity":"2yPLgUudQEGPaschdLdkGg","port":"Done"},"target":{"activity":"eHAEEQ-Iu0GwM3mRxZin0Q","port":"In"}},{"source":{"activity":"7RQ2sbVHo0SxsyK0dvTKEA","port":"Done"},"target":{"activity":"dVUuwMm5XUiYpiYoGo5JKA","port":"In"}},{"source":{"activity":"eHAEEQ-Iu0GwM3mRxZin0Q","port":"Done"},"target":{"activity":"dVUuwMm5XUiYpiYoGo5JKA","port":"In"}},{"source":{"activity":"dVUuwMm5XUiYpiYoGo5JKA","port":"Done"},"target":{"activity":"NpZ_yT_irUuE9ASEfYLxbw","port":"In"}}]}} \ No newline at end of file +{ + "id": "14984c048db34cceaf5e15ece80f9703", + "definitionId": "64f8f2c852f04dc28f60707034d7a906", + "name": "Join 2", + "createdAt": "2023-09-12T18:12:43.392272+00:00", + "version": 1, + "toolVersion": "3.0.0.0", + "variables": [], + "inputs": [], + "outputs": [], + "outcomes": [], + "customProperties": {}, + "isReadonly": false, + "isLatest": true, + "isPublished": true, + "options": { + "autoUpdateConsumingWorkflows": false + }, + "root": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "B2jpPDriPEe-zSOhVuAGeQ", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Start" + }, + "memoryReference": { + "id": "2yPLgUudQEGPaschdLdkGg:input-0" + } + }, + "id": "2yPLgUudQEGPaschdLdkGg", + "name": "WriteLine1", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -358.5, + "y": -229 + }, + "size": { + "width": 139.296875, + "height": 50 + } + }, + "displayText": "Start" + } + }, + { + "body": { + "type": "Elsa.Flowchart", + "version": 1, + "id": "zaAIlUtQDEaPqeITeRJ4_w", + "metadata": {}, + "customProperties": { + "source": "FlowchartJsonConverter.cs:46", + "notFoundConnections": [], + "canStartWorkflow": false, + "runAsynchronously": false + }, + "activities": [ + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Line 2" + }, + "memoryReference": { + "id": "g3jVTdvU3EK7V5JqRqfqjQ:input-0" + } + }, + "id": "g3jVTdvU3EK7V5JqRqfqjQ", + "name": "WriteLine1", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -279.5, + "y": -294 + }, + "size": { + "width": 139.296875, + "height": 50 + } + }, + "displayText": "Line 2" + } + } + ], + "connections": [] + }, + "id": "eHAEEQ-Iu0GwM3mRxZin0Q", + "name": "FlowNode1", + "type": "Elsa.FlowNode", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -120, + "y": -179 + }, + "size": { + "width": 211.15625, + "height": 120 + } + }, + "displayText": "Line 2" + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "Line 1" + }, + "memoryReference": { + "id": "7RQ2sbVHo0SxsyK0dvTKEA:input-0" + } + }, + "id": "7RQ2sbVHo0SxsyK0dvTKEA", + "name": "WriteLine2", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": -120, + "y": -279 + }, + "size": { + "width": 139.296875, + "height": 50 + } + }, + "displayText": "Line 1" + } + }, + { + "mode": { + "typeName": "Elsa.Workflows.Core.Activities.Flowchart.Models.FlowJoinMode, Elsa.Workflows.Core", + "expression": { + "type": "Literal", + "value": "WaitAll" + }, + "memoryReference": { + "id": "dVUuwMm5XUiYpiYoGo5JKA:input-0" + } + }, + "id": "dVUuwMm5XUiYpiYoGo5JKA", + "name": "FlowJoin1", + "type": "Elsa.FlowJoin", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 180.5, + "y": -229 + }, + "size": { + "width": 136.859375, + "height": 50 + } + } + } + }, + { + "text": { + "typeName": "String", + "expression": { + "type": "Literal", + "value": "End" + }, + "memoryReference": { + "id": "NpZ_yT_irUuE9ASEfYLxbw:input-0" + } + }, + "id": "NpZ_yT_irUuE9ASEfYLxbw", + "name": "WriteLine3", + "type": "Elsa.WriteLine", + "version": 1, + "customProperties": { + "canStartWorkflow": false, + "runAsynchronously": false + }, + "metadata": { + "designer": { + "position": { + "x": 400, + "y": -229 + }, + "size": { + "width": 139.296875, + "height": 50 + } + }, + "displayText": "End" + } + } + ], + "connections": [ + { + "source": { + "activity": "2yPLgUudQEGPaschdLdkGg", + "port": "Done" + }, + "target": { + "activity": "7RQ2sbVHo0SxsyK0dvTKEA", + "port": "In" + } + }, + { + "source": { + "activity": "2yPLgUudQEGPaschdLdkGg", + "port": "Done" + }, + "target": { + "activity": "eHAEEQ-Iu0GwM3mRxZin0Q", + "port": "In" + } + }, + { + "source": { + "activity": "7RQ2sbVHo0SxsyK0dvTKEA", + "port": "Done" + }, + "target": { + "activity": "dVUuwMm5XUiYpiYoGo5JKA", + "port": "In" + } + }, + { + "source": { + "activity": "eHAEEQ-Iu0GwM3mRxZin0Q", + "port": "Done" + }, + "target": { + "activity": "dVUuwMm5XUiYpiYoGo5JKA", + "port": "In" + } + }, + { + "source": { + "activity": "dVUuwMm5XUiYpiYoGo5JKA", + "port": "Done" + }, + "target": { + "activity": "NpZ_yT_irUuE9ASEfYLxbw", + "port": "In" + } + } + ] + } +} \ No newline at end of file