Skip to content

Releases: danielgerlag/workflow-core

v1.2.9

24 Jun 15:40
Compare
Choose a tag to compare

Workflow Core 1.2.9

  • .Recur() API, define a block of steps to execute on a recurring interval, until a condition becomes true

This following example will execute the block of every day until the StopRecurring field on the data object becomes true

builder                
    .StartWith<HelloWorld>()
    .Recur(data => TimeSpan.FromDays(1), data => data.StopRecurring)
		.Do(recur => recur
			.StartWith<DoSomething>()
			.Then<DoSomethingElse>())
    .Then<GoodbyeWorld>();
  • Added access to the execution context object when resolving an event key in the .WaitFor API
.WaitFor("event", (data, context) => context.Workflow.Id)
  • Deprecated UserStep in favour of the new UserTask API
  • Added basic escalation functionality to UserTask

This following example will create a user task with 2 options and 2 resultant paths, as well as escalate the task after 1 day.

builder
    .StartWith(context => ExecutionResult.Next())
    .UserTask("Do you approve", data => @"domain\bob")
        .WithOption("yes", "I approve").Do(then => then
            .StartWith(context => Console.WriteLine("You approved"))
        )
        .WithOption("no", "I do not approve").Do(then => then
            .StartWith(context => Console.WriteLine("You did not approve"))
        )
        .WithEscalation(x => TimeSpan.FromDays(1), x => @"domain\frank", action => action
            .StartWith(context => Console.WriteLine("Escalated task"))
            .Then(context => Console.WriteLine("Sending notification..."))
            )
    .Then(context => Console.WriteLine("end"));

v1.2.8

17 Jun 13:30
Compare
Choose a tag to compare

Workflow Core 1.2.8

  • .Schedule() API, to future date a block of steps to run in parallel to the rest of the workflow.

This following example will execute the block of steps after 3 days

builder                
    .StartWith<HelloWorld>()
    .Schedule(data => TimeSpan.FromDays(3)).Do(block => 
        block.StartWith<DoSomething>()
        .Then<DoSomethingElse>())
    .Then<GoodbyeWorld>();
  • .Delay() API, to put the current branch to sleep for a specified period
builder                
    .StartWith<HelloWorld>()
    .Delay(data => TimeSpan.FromMinutes(5))
    .Then<GoodbyeWorld>();
  • Overload of the .Input() method to allow access to the context object
builder
    .StartWith<SayHello>()
    .ForEach(data => new List<int>() { 1, 2, 3, 4 })
        .Do(x => x
            .StartWith<DisplayContext>()
                .Input(step => step.Item, (data, context) => context.Item)
            .Then<DoSomething>())
    .Then<SayGoodbye>();
  • Inline action steps API
builder                
    .StartWith(context => Console.WriteLine("Hello!"))
    .Then(context => Console.WriteLine("Bye!"));
  • Discontinued support for .NET 4.5.2 (.NET 4.6 is .NET Standard 1.3 compatible)

1.2.7

15 Jun 01:24
Compare
Choose a tag to compare
sql locking