WIP #728 - Make WorkflowBurst default behaviour
In the comments to #728 it was suggested that WorkflowBurst persistence behaviour was a more sane default.
This commit is contained in:
parent
32bcf9a751
commit
8751bead5a
|
|
@ -6,16 +6,22 @@ namespace Elsa.Models
|
|||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum WorkflowPersistenceBehavior
|
||||
{
|
||||
// TODO: Consider a new service to "get the default persistence behaviour".
|
||||
// Currently it is set to WorkflowBurst implicitly because it is the default
|
||||
// for the enum type. This would be more clear if explicit.
|
||||
// This includes altering all locations which need a default persistence
|
||||
// behaviour though.
|
||||
|
||||
/// <summary>
|
||||
/// Workflow instances are persisted after the workflow completed a burst of execution.
|
||||
/// </summary>
|
||||
WorkflowBurst = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow instances are persisted only when being suspended.
|
||||
/// </summary>
|
||||
Suspended,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow instances are persisted after the workflow completed a burst of execution.
|
||||
/// </summary>
|
||||
WorkflowBurst,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow instances are persisted after the workflow executed scheduled activities.
|
||||
/// </summary>
|
||||
|
|
|
|||
29
test/unit/Elsa.UnitTests/Services/WorkflowBuilderTests.cs
Normal file
29
test/unit/Elsa.UnitTests/Services/WorkflowBuilderTests.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using AutoFixture.Xunit2;
|
||||
using Elsa.Builders;
|
||||
using Elsa.Models;
|
||||
using Elsa.Testing.Shared.AutoFixture.Attributes;
|
||||
using Xunit;
|
||||
|
||||
namespace Elsa.Services
|
||||
{
|
||||
public class WorkflowBuilderTests
|
||||
{
|
||||
[Theory(DisplayName = "The Build method should return a workflow blueprint with the WorkflowBurst persistence behaviour if no behaviour was specified"), AutoMoqData]
|
||||
public void BuildShouldReturnWorkflowBlueprintWithWorkflowBurstPersistenceBehaviourIfNoBehaviourSpecified([AutofixtureServiceProvider, Frozen] IServiceProvider serviceProvider,
|
||||
WorkflowBuilder sut,
|
||||
string idPrefix)
|
||||
{
|
||||
var workflow = new NoOpWorkflow();
|
||||
|
||||
var blueprint = sut.Build(workflow, idPrefix);
|
||||
|
||||
Assert.Equal(WorkflowPersistenceBehavior.WorkflowBurst, blueprint.PersistenceBehavior);
|
||||
}
|
||||
|
||||
class NoOpWorkflow : IWorkflow
|
||||
{
|
||||
public void Build(IWorkflowBuilder builder) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue