public void RunWorkflow()
{
var executionContext = new ActionExecutionContext();
Coroutine.BeginExecute(GetSampleWorkflow().GetEnumerator(), executionContext, Complete);
}
private static void Complete(object sender, ResultCompletionEventArgs e)
{
if (e.Error != null)
throw new Exception("Error on SampleWorkflow",e.Error);
}
private IEnumerable<IResult> GetSampleWorkflow()
{
var coroutine1 = new SampleCoroutines();
yield return coroutine1;
//Do something with the result
var coroutine2 = new SampleCoroutines2();
yield return coroutine2;
yield break;
}