/// <summary>
 /// Refreshes the previous interruption, used for reporting on the guided interruption.
 /// </summary>
 private void UpdatePreviousIntervention()
 {
     previousInterruptionToProcess = octRepositoryToManage.Interruptions.Get(currentInterruptionToProcess.Id);
     while ((previousInterruptionToProcess.IsPending || previousInterruptionToProcess.ResponsibleUserId == null || previousInterruptionToProcess.Form == null || previousInterruptionToProcess.Form.Values[ResourceStrings.InterventionResultKey] == null) && Status != TaskManagerStatus.Canceled)
     {
         previousInterruptionToProcess = octRepositoryToManage.Interruptions.Get(currentInterruptionToProcess.Id);
     }
 }
示例#2
0
        /// <summary>
        /// Responds to the interruption.
        /// </summary>
        /// <param name="octRepository">The repository to call against.</param>
        /// <param name="interruption"></param>
        /// <param name="response"></param>
        /// <param name="note"></param>
        public static void InterruptionReponse(OctopusRepository octRepository, InterruptionResource interruption, InterruptionResponse response, string note)
        {
            var stringResponse = Enum.GetName(typeof(InterruptionResponse), response);

            interruption.Form.Values[ResourceStrings.InterruptionGuidanceKey] = stringResponse;
            interruption.Form.Values[ResourceStrings.InterruptionNoteKey]     = note;
            octRepository.Interruptions.TakeResponsibility(interruption);
            octRepository.Interruptions.Submit(interruption);
        }
        /// <summary>
        /// Refreshes the current pending intervention, if one exists.
        /// </summary>
        public void UpdateIntervention()
        {
            var updatedIntervention = InterruptionHelper.GetLastInterruption(octRepositoryToManage, taskToManage);

            if (updatedIntervention != null && !updatedIntervention.Equals(currentInterventionToProcess))
            {
                currentInterruptionToProcess = updatedIntervention;
            }
        }
示例#4
0
        /// <summary>
        /// Gathers the Step name of the interruption from the CorrelationId
        /// </summary>
        /// <param name="octRepository"></param>
        /// <param name="interruption"></param>
        /// <returns></returns>
        public static string GetInterruptedStepName(OctopusRepository octRepository, InterruptionResource interruption)
        {
            var task             = TaskHelper.GetTaskFromId(octRepository, interruption.TaskId);
            var activityElements = TaskHelper.GetActivityElementList(octRepository, task);
            var stepName         = string.Empty;

            foreach (var activityElement in activityElements)
            {
                if (string.IsNullOrEmpty(stepName))
                {
                    stepName = ActivityElementHelper.GetStepNameById(activityElement, interruption.CorrelationId);
                }
            }
            return(stepName);
        }
示例#5
0
        /// <summary>
        /// Gets the manual Intervention Step Instructions
        /// </summary>
        /// <param name="octRepository"></param>
        /// <param name="interruption"></param>
        /// <returns></returns>
        public static string GetInterventionDirections(OctopusRepository octRepository, InterruptionResource interruption)
        {
            var instructions            = string.Empty;
            var interruptionformElement = interruption.Form.Elements.Where(e => e.Name.Equals(ResourceStrings.InterventionInstructions)).FirstOrDefault();

            if (interruptionformElement != null && interruptionformElement.Control.GetType() == typeof(Octopus.Client.Model.Forms.Paragraph))
            {
                instructions = ((Octopus.Client.Model.Forms.Paragraph)interruptionformElement.Control).Text;
            }
            return(instructions);
        }
 public void TakeResponsibility(InterruptionResource interruption)
 {
     throw new NotImplementedException();
 }
 public void Submit(InterruptionResource interruption)
 {
     throw new NotImplementedException();
 }
 public InterruptionResource Refresh(InterruptionResource resource)
 {
     throw new NotImplementedException();
 }
 public UserResource GetResponsibleUser(InterruptionResource interruption)
 {
     throw new NotImplementedException();
 }