Add project files.
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
using Elsa.Testing.Shared;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Elsa.Workflows.IntegrationTests.Scenarios.ParentChildCompletion;
|
||||
|
||||
/// <summary>
|
||||
/// Tests for mapping an activity's output directly to the workflow's output definition.
|
||||
/// </summary>
|
||||
public class Tests
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
|
||||
public Tests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
_services = new TestApplicationBuilder(testOutputHelper).Build();
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "Parent workflow invoking child workflow as activity completes successfully.")]
|
||||
public async Task Test1()
|
||||
{
|
||||
// Populate registries.
|
||||
await _services.PopulateRegistriesAsync();
|
||||
|
||||
// Import child workflow.
|
||||
var childWorkflowFilename = "Scenarios/ParentChildCompletion/Workflows/child.json";
|
||||
await _services.ImportWorkflowDefinitionAsync(childWorkflowFilename);
|
||||
|
||||
// Import parent workflow.
|
||||
var parentWorkflowFilename = "Scenarios/ParentChildCompletion/Workflows/parent.json";
|
||||
var parentWorkflowDefinition = await _services.ImportWorkflowDefinitionAsync(parentWorkflowFilename);
|
||||
|
||||
// Execute.
|
||||
var workflowState = await _services.RunWorkflowUntilEndAsync(parentWorkflowDefinition.DefinitionId);
|
||||
|
||||
// Assert expected status
|
||||
Assert.Equal(WorkflowStatus.Finished, workflowState.Status);
|
||||
}
|
||||
}
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
{
|
||||
"id": "c8109a84c584c83c",
|
||||
"definitionId": "3dcdbf22d29d6e60",
|
||||
"name": "Subworkflow test",
|
||||
"createdAt": "2023-11-10T13:03:21.734094+00:00",
|
||||
"version": 4,
|
||||
"toolVersion": "3.0.0.0",
|
||||
"variables": [
|
||||
{
|
||||
"id": "c0dbe71ceb21ee4f",
|
||||
"name": "Variable1",
|
||||
"typeName": "Object",
|
||||
"isArray": false,
|
||||
"storageDriverTypeName": "Elsa.Workflows.Services.WorkflowStorageDriver, Elsa.Workflows.Core"
|
||||
}
|
||||
],
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"outcomes": [
|
||||
"Success",
|
||||
"Failure"
|
||||
],
|
||||
"customProperties": {},
|
||||
"isReadonly": false,
|
||||
"isLatest": true,
|
||||
"isPublished": true,
|
||||
"options": {
|
||||
"usableAsActivity": true,
|
||||
"autoUpdateConsumingWorkflows": true
|
||||
},
|
||||
"root": {
|
||||
"type": "Elsa.Flowchart",
|
||||
"version": 1,
|
||||
"id": "2492a1125f14bc2d",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d",
|
||||
"metadata": {},
|
||||
"customProperties": {
|
||||
"source": "FlowchartJsonConverter.cs:47",
|
||||
"notFoundConnections": [],
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"activities": [
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "test"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "a3625dd2e8405265:input-0"
|
||||
}
|
||||
},
|
||||
"id": "a3625dd2e8405265",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:a3625dd2e8405265",
|
||||
"name": "WriteLine1",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": true,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": -174,
|
||||
"y": 302
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "1"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "31d29bf86b2b62cb:input-0"
|
||||
}
|
||||
},
|
||||
"id": "31d29bf86b2b62cb",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:31d29bf86b2b62cb",
|
||||
"name": "WriteLine3",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 132.6484375,
|
||||
"y": 292
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "11"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "57576570e00a4c70:input-0"
|
||||
}
|
||||
},
|
||||
"id": "57576570e00a4c70",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:57576570e00a4c70",
|
||||
"name": "WriteLine5",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 449.6484375,
|
||||
"y": 280
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "22"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "caa57f31b8d0e0d1:input-0"
|
||||
}
|
||||
},
|
||||
"id": "caa57f31b8d0e0d1",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:caa57f31b8d0e0d1",
|
||||
"name": "WriteLine4",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 449.6484375,
|
||||
"y": 563
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"script": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "return {\u0022prop1\u0022:\u0022ceva\u0022}"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "fb20dbd8777282b2:input-0"
|
||||
}
|
||||
},
|
||||
"possibleOutcomes": null,
|
||||
"result": {
|
||||
"typeName": "Object",
|
||||
"memoryReference": {
|
||||
"id": "c0dbe71ceb21ee4f"
|
||||
}
|
||||
},
|
||||
"id": "fb20dbd8777282b2",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:fb20dbd8777282b2",
|
||||
"name": "RunJavaScript1",
|
||||
"type": "Elsa.RunJavaScript",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 114.453125,
|
||||
"y": 563
|
||||
},
|
||||
"size": {
|
||||
"width": 175.6875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"outcomes": {
|
||||
"typeName": "Object",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "Success"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "8654ab45535f4069:input-0"
|
||||
}
|
||||
},
|
||||
"id": "8654ab45535f4069",
|
||||
"nodeId": "Workflow1:2492a1125f14bc2d:8654ab45535f4069",
|
||||
"name": "Complete1",
|
||||
"type": "Elsa.Complete",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 738.7582397460938,
|
||||
"y": 690.54443359375
|
||||
},
|
||||
"size": {
|
||||
"width": 136.8125,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"source": {
|
||||
"activity": "a3625dd2e8405265",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "31d29bf86b2b62cb",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "31d29bf86b2b62cb",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "57576570e00a4c70",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "fb20dbd8777282b2",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "caa57f31b8d0e0d1",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "a3625dd2e8405265",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "fb20dbd8777282b2",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "caa57f31b8d0e0d1",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "8654ab45535f4069",
|
||||
"port": "In"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
{
|
||||
"id": "34991d27edc12ae5",
|
||||
"definitionId": "89d6fe82a11fbed6",
|
||||
"name": "Mainworkflow test",
|
||||
"createdAt": "2023-11-10T21:01:49.123204+00:00",
|
||||
"version": 2,
|
||||
"toolVersion": "3.0.0.0",
|
||||
"variables": [],
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"outcomes": [],
|
||||
"customProperties": {
|
||||
"Elsa:WorkflowContextProviderTypes": []
|
||||
},
|
||||
"isReadonly": false,
|
||||
"isLatest": true,
|
||||
"isPublished": true,
|
||||
"options": {
|
||||
"autoUpdateConsumingWorkflows": false
|
||||
},
|
||||
"root": {
|
||||
"type": "Elsa.Flowchart",
|
||||
"version": 1,
|
||||
"id": "f9071ee83c88d765",
|
||||
"nodeId": "Workflow1:f9071ee83c88d765",
|
||||
"metadata": {},
|
||||
"customProperties": {
|
||||
"source": "FlowchartJsonConverter.cs:47",
|
||||
"notFoundConnections": [],
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"activities": [
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "Success"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "77069142b8b9da15:input-0"
|
||||
}
|
||||
},
|
||||
"id": "77069142b8b9da15",
|
||||
"nodeId": "Workflow1:f9071ee83c88d765:77069142b8b9da15",
|
||||
"name": "WriteLine2",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 231.8203125,
|
||||
"y": 200
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "Failure"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "34e3dcda423f3c1c:input-0"
|
||||
}
|
||||
},
|
||||
"id": "34e3dcda423f3c1c",
|
||||
"nodeId": "Workflow1:f9071ee83c88d765:34e3dcda423f3c1c",
|
||||
"name": "WriteLine3",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": 231.8203125,
|
||||
"y": 393
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"text": {
|
||||
"typeName": "String",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": "Start"
|
||||
},
|
||||
"memoryReference": {
|
||||
"id": "8b7bf9cd03c066fa:input-0"
|
||||
}
|
||||
},
|
||||
"id": "8b7bf9cd03c066fa",
|
||||
"nodeId": "Workflow1:f9071ee83c88d765:8b7bf9cd03c066fa",
|
||||
"name": "WriteLine1",
|
||||
"type": "Elsa.WriteLine",
|
||||
"version": 1,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": -340,
|
||||
"y": 309
|
||||
},
|
||||
"size": {
|
||||
"width": 139.296875,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"workflowDefinitionId": "b8b45fd4dbffad5d",
|
||||
"workflowDefinitionVersionId": "24dd11bc73a881d5",
|
||||
"latestAvailablePublishedVersion": 7,
|
||||
"latestAvailablePublishedVersionId": "24dd11bc73a881d5",
|
||||
"id": "abcd6d3d391bfe10",
|
||||
"nodeId": "Workflow1:f9071ee83c88d765:abcd6d3d391bfe10",
|
||||
"name": "SubworkflowTest1",
|
||||
"type": "SubworkflowTest",
|
||||
"version": 7,
|
||||
"customProperties": {
|
||||
"canStartWorkflow": false,
|
||||
"runAsynchronously": false
|
||||
},
|
||||
"metadata": {
|
||||
"designer": {
|
||||
"position": {
|
||||
"x": -54,
|
||||
"y": 309
|
||||
},
|
||||
"size": {
|
||||
"width": 157.09375,
|
||||
"height": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"source": {
|
||||
"activity": "8b7bf9cd03c066fa",
|
||||
"port": "Done"
|
||||
},
|
||||
"target": {
|
||||
"activity": "abcd6d3d391bfe10",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "abcd6d3d391bfe10",
|
||||
"port": "Success"
|
||||
},
|
||||
"target": {
|
||||
"activity": "77069142b8b9da15",
|
||||
"port": "In"
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {
|
||||
"activity": "abcd6d3d391bfe10",
|
||||
"port": "Failure"
|
||||
},
|
||||
"target": {
|
||||
"activity": "34e3dcda423f3c1c",
|
||||
"port": "In"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user