public override ActivityResult Execute(IEvent e) { var data = Selector != null?e.GetEventData(Selector) : e.GetEventData(); Variables[VariableName] = data; return(ActivityResult.Success()); }
public override ActivityResult Execute(IEvent e) { var text = Selector != null?e.GetEventData(Selector).ToString() : e.GetEventData().ToString(); if (Template != null) { Console.WriteLine(Template.Replace(Selector, text)); } else { Console.WriteLine(text); } return(ActivityResult.Success()); }
public override ActivityResult Execute(IEvent e) { try { if (e.GetEventData() != null) { object data = Condition.Selector != null?e.GetEventData(Condition.Selector) : e.GetEventData(); switch (Condition.Operator) { case ConditionOperator.EQ: if (data.Equals(Condition.ExpectedValue)) { ExecuteDoNodes(e); } else { ExecuteElseNodes(e); } break; case ConditionOperator.NE: if (!data.Equals(Condition.ExpectedValue)) { ExecuteDoNodes(e); } else { ExecuteElseNodes(e); } break; default: break; } } else { throw new Exception("Expected condition in ConditionEvent."); } } catch (Exception ex) { return(ActivityResult.Failure(ex)); } return(ActivityResult.Success()); }
public override ActivityResult Execute(IEvent e) { try { foreach (var item in Items) { foreach (var hook in this._hooks) { hook.OnEach(item, ItemType); } } } catch (Exception ex) { return(ActivityResult.Failure(ex)); } return(ActivityResult.Success()); }
public virtual ActivityResult Execute(IEvent e) { return(ActivityResult.Success()); }