diff --git a/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs b/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs index 42a0d7b10..3a706b514 100644 --- a/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs +++ b/src/core/Elsa.Abstractions/Services/Workflows/IWorkflowLaunchpad.cs @@ -30,7 +30,7 @@ namespace Elsa.Services Task FindStartableWorkflowAsync(string workflowDefinitionId, string? activityId = default, string? correlationId = default, string? contextId = default, string? tenantId = default, CancellationToken cancellationToken = default); /// - /// Creates a new test workflow instance with execution pending for the specified workflow blueprint using the specified starting activity ID. + /// Creates a new workflow instance with execution pending for the specified workflow blueprint version using the specified starting activity ID. /// Task FindStartableWorkflowAsync(string workflowDefinitionId, int version, string? activityId = default, string? correlationId = default, string? contextId = default, string? tenantId = default, CancellationToken cancellationToken = default); diff --git a/src/designer/elsa-workflows-studio/src/components/editors/properties/elsa-script-property/elsa-script-property.tsx b/src/designer/elsa-workflows-studio/src/components/editors/properties/elsa-script-property/elsa-script-property.tsx index 919ded464..3a15bfc70 100644 --- a/src/designer/elsa-workflows-studio/src/components/editors/properties/elsa-script-property/elsa-script-property.tsx +++ b/src/designer/elsa-workflows-studio/src/components/editors/properties/elsa-script-property/elsa-script-property.tsx @@ -64,7 +64,7 @@ export class ElsaScriptProperty { value: value, data: null, isValidated: false, - isPositiveResult: false + isValid: false }; eventBus.emit(EventTypes.ActivityPluginValidating, this, this.activityValidatingContext); } @@ -85,7 +85,7 @@ export class ElsaScriptProperty { if (this.activityValidatingContext == null || !this.activityValidatingContext.isValidated) return; - const isPositiveResult = this.activityValidatingContext.isPositiveResult; + const isPositiveResult = this.activityValidatingContext.isValid; const color = isPositiveResult ? 'green' : 'red'; return ( diff --git a/src/designer/elsa-workflows-studio/src/components/screens/workflow-definition-editor/elsa-workflow-test-panel/elsa-workflow-test-panel.tsx b/src/designer/elsa-workflows-studio/src/components/screens/workflow-definition-editor/elsa-workflow-test-panel/elsa-workflow-test-panel.tsx index 53665ff93..76aaadd1d 100644 --- a/src/designer/elsa-workflows-studio/src/components/screens/workflow-definition-editor/elsa-workflow-test-panel/elsa-workflow-test-panel.tsx +++ b/src/designer/elsa-workflows-studio/src/components/screens/workflow-definition-editor/elsa-workflow-test-panel/elsa-workflow-test-panel.tsx @@ -103,12 +103,13 @@ export class ElsaWorkflowTestPanel { const renderActivityTestMessage = () => { const {message} = this; - + if (message == undefined || !message) return - let workflowStatus = this.workflowTestActivityMessages.last().workflowStatus; - + const workflowStatus = this.workflowTestActivityMessages.last().workflowStatus; + debugger + const t = (x, params?) => this.i18next.t(x, params); return ( @@ -117,19 +118,19 @@ export class ElsaWorkflowTestPanel {
{t('Status')}
{workflowStatus}
- {!!message.path ? + {!!message.activityData["Path"] ?
{t('EntryEndpoint')}
-
 clip(e.currentTarget)}>{this.serverUrl + '/workflows' + message.path + '?correlation=' + message.correlationId}
+
 clip(e.currentTarget)}>{this.serverUrl + '/workflows' + message.activityData["Path"].value + '?correlation=' + message.correlationId}
-
+
: - '' + undefined } ); diff --git a/src/designer/elsa-workflows-studio/src/models/domain.ts b/src/designer/elsa-workflows-studio/src/models/domain.ts index 8e33eb79c..58772ed84 100644 --- a/src/designer/elsa-workflows-studio/src/models/domain.ts +++ b/src/designer/elsa-workflows-studio/src/models/domain.ts @@ -324,7 +324,6 @@ export class SyntaxNames { } export interface WorkflowTestActivityMessage { - path?: string; workflowInstanceId: string; correlationId: string; activityId: string; @@ -332,6 +331,7 @@ export interface WorkflowTestActivityMessage { workflowStatus: string; data?: any; error?: string; + activityData?: any; } export const getVersionOptionsString = (versionOptions?: VersionOptions) => { diff --git a/src/designer/elsa-workflows-studio/src/models/events.ts b/src/designer/elsa-workflows-studio/src/models/events.ts index fef1e1295..274e9ffed 100644 --- a/src/designer/elsa-workflows-studio/src/models/events.ts +++ b/src/designer/elsa-workflows-studio/src/models/events.ts @@ -70,7 +70,7 @@ export interface ActivityValidatingContext { value?: string, isValidated: boolean, data: any, - isPositiveResult: boolean + isValid: boolean } export interface ActivityDescriptorDisplayContext { diff --git a/src/designer/elsa-workflows-studio/src/plugins/http-endpoint-plugin.tsx b/src/designer/elsa-workflows-studio/src/plugins/http-endpoint-plugin.tsx index 4e7f525d0..ff8ae0e9a 100644 --- a/src/designer/elsa-workflows-studio/src/plugins/http-endpoint-plugin.tsx +++ b/src/designer/elsa-workflows-studio/src/plugins/http-endpoint-plugin.tsx @@ -68,7 +68,7 @@ export class HttpEndpointPlugin implements ElsaPlugin { } context.isValidated = true; - context.isPositiveResult = isValid; + context.isValid = isValid; context.data = isValid ? 'Json is valid' : 'Json is invalid'; } } diff --git a/src/server/Elsa.Server.Api/Handlers/ActivityExecutionResultExecutedHandler.cs b/src/server/Elsa.Server.Api/Handlers/ActivityExecutionResultExecutedHandler.cs index f660e44bb..aebf2b11e 100644 --- a/src/server/Elsa.Server.Api/Handlers/ActivityExecutionResultExecutedHandler.cs +++ b/src/server/Elsa.Server.Api/Handlers/ActivityExecutionResultExecutedHandler.cs @@ -24,7 +24,7 @@ namespace Elsa.Server.Api.Handlers public async Task Handle(ActivityExecutionResultExecuted notification, CancellationToken cancellationToken) { var context = notification.ActivityExecutionContext; - string? path = default; + //string? path = default; var signalRConnectionId = context.WorkflowExecutionContext.WorkflowInstance.GetMetadata("signalRConnectionId")?.ToString(); if (string.IsNullOrWhiteSpace(signalRConnectionId)) return; @@ -34,24 +34,26 @@ namespace Elsa.Server.Api.Handlers ["Outcomes"] = JToken.FromObject(context.Outcomes) }; - if (context.ActivityBlueprint.Type == "HttpEndpoint") - { + //if (context.ActivityBlueprint.Type == "HttpEndpoint") + //{ var body = context.Input != null ? ((dynamic)context.Input).Body : null; if (body != null) data["Body"] = JToken.FromObject(body); - var activityData = context.WorkflowInstance.ActivityData.FirstOrDefault(x => x.Key == notification.ActivityExecutionContext.ActivityId); - var pathProperty = activityData.Value.FirstOrDefault(x => x.Key == "Path"); - if (pathProperty.Value != null) - { - path = pathProperty.Value.ToString(); - } - } + // var activityData = context.WorkflowInstance.ActivityData.FirstOrDefault(x => x.Key == notification.ActivityExecutionContext.ActivityId); + // var pathProperty = activityData.Value.FirstOrDefault(x => x.Key == "Path"); + // if (pathProperty.Value != null) + // { + // path = pathProperty.Value.ToString(); + // } + //} + + var activityData = context.WorkflowInstance.ActivityData.FirstOrDefault(x => x.Key == notification.ActivityExecutionContext.ActivityId).Value; var message = new WorkflowTestMessage { - Path = path, + //Path = path, WorkflowInstanceId = context.WorkflowInstance.Id, CorrelationId = context.CorrelationId, ActivityId = context.ActivityId, @@ -59,7 +61,8 @@ namespace Elsa.Server.Api.Handlers ? "Executed" : context.WorkflowExecutionContext.Status.ToString(), Data = JsonConvert.SerializeObject(data, Formatting.Indented), - Status = GetExecutionResult(notification.Result) + Status = GetExecutionResult(notification.Result), + ActivityData = activityData }; await _workflowTestService.DispatchMessage(signalRConnectionId, message); diff --git a/src/server/Elsa.Server.Api/Models/WorkflowTestMessage.cs b/src/server/Elsa.Server.Api/Models/WorkflowTestMessage.cs index 122b15ef9..e73b45183 100644 --- a/src/server/Elsa.Server.Api/Models/WorkflowTestMessage.cs +++ b/src/server/Elsa.Server.Api/Models/WorkflowTestMessage.cs @@ -1,8 +1,9 @@ +using System.Collections.Generic; + namespace Elsa.Server.Api.Models { public class WorkflowTestMessage { - public string? Path { get; set; } public string WorkflowInstanceId { get; set; } = default!; public string CorrelationId { get; set; } = default!; public string ActivityId { get; set; } = default!; @@ -10,5 +11,6 @@ namespace Elsa.Server.Api.Models public string WorkflowStatus { get; set; } = default!; public object? Data { get; set; } public string? Error { get; set; } + public IDictionary? ActivityData { get; set; } } }