/// <summary> /// Schedule the activity given by name and version. Activity should be already registered with Amazon SWF. /// </summary> /// <param name="name">Name of the activity.</param> /// <param name="version">Version of the activity.</param> /// <param name="positionalName">A user defined name to differentiate same activity at multiple positions in workflow.</param> /// <returns></returns> protected IFluentActivityItem ScheduleActivity(string name, string version, string positionalName = "") { Ensure.NotNullAndEmpty(name, "name"); Ensure.NotNullAndEmpty(version, "version"); var activityItem = new ActivityItem(Identity.New(name, version, positionalName), this); if (!_allWorkflowItems.Add(activityItem)) { throw new DuplicateItemException(string.Format(Resources.Duplicate_activity, name, version, positionalName)); } return(activityItem); }