This project is read-only.
Install using the visual studio package manager console
install-package objectflow.core

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 Nov 16, 2012 at 9:15 PM by djnz_gea, version 3


No comments yet.