Install using the visual studio package manager console
install-package objectflow.core -pre

Install using Nuget on the commandline
nuget.exe install objectflow.core -pre

Create a class to identify states
public class CustomerState 
    public bool OrderPlaced { get; set; }     
    public bool Paid { get; set; }     
    public bool DrinkReceived { get; set; }

Define a simple workflow
var customerWorkflow = Workflow<CustomerState>.Definition()
    .On<Exception>(() => Console.WriteLine("Caught an exception"))

Define operations
public class PlaceOrder : BasicOperation<CustomerState>
    public override CustomerState Execute(CustomerState data)
        Console.WriteLine("Place order;");
        data.OrderPlaced = true;
        return data;

Run the workflow
CustomerState endState = customerWorkflow.Start(new CustomerState());

Last edited Sep 19, 2012 at 9:00 AM by djnz_gea, version 6


andrejkaurin Dec 20, 2012 at 10:12 PM 
It would be great to have sample application to evaluate. Wondering where is the place where you initialize workflow?