Пример #1
0
        public override ActivityResult Execute(IEvent e)
        {
            var data = Selector != null?e.GetEventData(Selector) : e.GetEventData();

            Variables[VariableName] = data;
            return(ActivityResult.Success());
        }
Пример #2
0
        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());
        }
Пример #3
0
        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());
        }
Пример #4
0
 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());
 }
Пример #5
0
 public virtual ActivityResult Execute(IEvent e)
 {
     return(ActivityResult.Success());
 }