public override ExecState ExecuteImmediate(ExecuteContext context) { bool condition = false; if (context.IsContinue) { condition = context.Restore <Boolean>(Ref, "Condition"); } else { condition = context.Evaluate(Condition); context.Store(Ref, "Condition", condition); } if (condition) { if (Then != null) { return(Parent.FindActivity(Then).ExecuteImmediate(context)); } } else { if (Else != null) { return(Parent.FindActivity(Else).ExecuteImmediate(context)); } } return(ExecuteNext(context)); }
public override ExecState ExecuteImmediate(ExecuteContext context) { Int32 index = 0; if (context.IsContinue) { index = context.Restore <Int32>(Ref, "Index"); } while (index < Steps.Count) { context.Store(Ref, "Index", index); var st = Steps[index].ExecuteImmediate(context); if (st != ExecState.Complete) { return(st); } index += 1; } return(ExecState.Complete); }
public override ExecState ExecuteImmediate(ExecuteContext context) { String stepName = ""; if (context.IsContinue) { stepName = context.Restore <String>(Ref, "Step"); } else { stepName = Steps.FirstOrDefault(x => x.IsStart).Ref; } var step = FindActivity(stepName); var st = step.ExecuteImmediate(context); if (st != ExecState.Complete) { return(st); } return(ExecuteNext(context)); }
public override ExecState ExecuteImmediate(ExecuteContext context) { Boolean condition = false; if (context.IsContinue) { condition = context.Restore <Boolean>(Ref, "Condition"); } else { condition = context.Evaluate(Condition); } if (condition) { return(Then.ExecuteImmediate(context)); } else { return(Else.ExecuteImmediate(context)); } }