Example #1
0
        /// <summary>
        /// Jump to an activity. Exception is thrown if activity is already active or not found in workflow.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="version"></param>
        /// <param name="positionalName"></param>
        /// <returns></returns>
        public JumpWorkflowAction ToActivity(string name, string version, string positionalName = "")
        {
            Ensure.NotNullAndEmpty(name, "name");
            Ensure.NotNullAndEmpty(version, "version");

            var activityItem = _workflowItems.ActivityItemFor(Identity.New(name, version, positionalName));

            return(WorkflowAction.JumpTo(activityItem).WithTriggerAction(_triggeringAction(activityItem)));
        }
Example #2
0
        /// <summary>
        /// Returns the workflow action to cancel the given activity.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="version"></param>
        /// <param name="positionalName"></param>
        /// <returns></returns>
        public WorkflowAction ForActivity(string name, string version, string positionalName = "")
        {
            Ensure.NotNullAndEmpty(name, "name");
            Ensure.NotNullAndEmpty(version, "version");

            var activityItem = _workflowItems.ActivityItemFor(Identity.New(name, version, positionalName));

            return(WorkflowAction.Cancel(activityItem));
        }
Example #3
0
        WorkflowAction IWorkflow.OnActivityCompletion(ActivityCompletedEvent activityCompletedEvent)
        {
            IActivity activity = _allWorkflowItems.ActivityItemFor(activityCompletedEvent);

            return(activity.Completed(activityCompletedEvent));
        }