Fix CLR materializer
Fix that workflows materialized from CLR materializer lose definition version ID and version
This commit is contained in:
parent
c9e2b11dfe
commit
369e4e52c8
|
|
@ -1,5 +1,6 @@
|
|||
using Elsa.Workflows.Core.Activities;
|
||||
using Elsa.Workflows.Core.Contracts;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
using Elsa.Workflows.Management.Contracts;
|
||||
using Elsa.Workflows.Management.Entities;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -19,7 +20,7 @@ public class ClrWorkflowMaterializer : IWorkflowMaterializer
|
|||
private readonly IPayloadSerializer _payloadSerializer;
|
||||
private readonly IWorkflowBuilderFactory _workflowBuilderFactory;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ClrWorkflowMaterializer"/> class.
|
||||
/// </summary>
|
||||
|
|
@ -46,6 +47,9 @@ public class ClrWorkflowMaterializer : IWorkflowMaterializer
|
|||
var workflowDefinitionBuilder = _workflowBuilderFactory.CreateBuilder();
|
||||
var workflow = await workflowDefinitionBuilder.BuildWorkflowAsync(workflowBuilder, cancellationToken);
|
||||
|
||||
// Assign identities from the definition.
|
||||
workflow.Identity = new WorkflowIdentity(definition.DefinitionId, definition.Version, definition.Id);
|
||||
|
||||
return workflow;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue