Ejemplo n.º 1
0
        public IFluentActivityItem AfterTimer(string name)
        {
            Ensure.NotNullAndEmpty(name, "timerName");

            AddParent(Identity.Timer(name));
            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Jump to workflow timer. Exceptio is thrown if timer is already active or not found in workflow.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public JumpWorkflowAction ToTimer(string name)
        {
            Ensure.NotNullAndEmpty(name, "name");
            var timerItem = _workflowItems.TimerItemFor(Identity.Timer(name));

            return(WorkflowAction.JumpTo(timerItem).WithTriggerAction(_triggeringAction(timerItem)));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the workflow action to cancel the timer.
        /// </summary>
        /// <param name="timerName"></param>
        /// <returns></returns>
        public WorkflowAction ForTimer(string timerName)
        {
            Ensure.NotNullAndEmpty(timerName, "timerName");

            var timerItem = _workflowItems.TimerItemFor(Identity.Timer(timerName));

            return(WorkflowAction.Cancel(timerItem));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Schedule the timer.
        /// </summary>
        /// <param name="name">Any user defined name to assign to this timer.</param>
        /// <returns></returns>
        protected IFluentTimerItem ScheduleTimer(string name)
        {
            Ensure.NotNullAndEmpty(name, "name");

            var timerItem = TimerItem.New(Identity.Timer(name), this);

            if (!_allWorkflowItems.Add(timerItem))
            {
                throw new DuplicateItemException(string.Format(Resources.Duplicate_timer, name));
            }

            return(timerItem);
        }
Ejemplo n.º 5
0
 public static ITimerItem First(this IEnumerable <ITimerItem> timerItems, string name)
 {
     Ensure.NotNull(timerItems, "timerItems");
     return(timerItems.OfType <TimerItem>().First(t => t.Has(Identity.Timer(name))));
 }
Ejemplo n.º 6
0
 public static ITimerItem ParentTimer(this IWorkflowItem workflowItem, string name)
 {
     Ensure.NotNull(workflowItem, "workflowItem");
     return(workflowItem.ParentTimers.OfType <TimerItem>()
            .FirstOrDefault(a => a.Has(Identity.Timer(name))));
 }
Ejemplo n.º 7
0
 public IFluentWorkflowActionItem AfterTimer(string name)
 {
     AddParent(Identity.Timer(name));
     return(this);
 }
Ejemplo n.º 8
0
 public IFluentChildWorkflowItem AfterTimer(string name)
 {
     Ensure.NotNullAndEmpty(name, nameof(name));
     AddParent(Identity.Timer(name));
     return(this);
 }