예제 #1
0
 public void Add(WorkStatus workStatus)
 {
     Add(new List <WorkStatus>()
     {
         workStatus
     });
 }
예제 #2
0
        public void Add(IOrchestrationJob job, AnalyticsRunStatus taskStatus, List <WorkStatusMessage> messages, int progress, bool writeChildren, bool canCancel)
        {
            var statuses = new List <WorkStatus>();

            var status = new WorkStatus(job.analyticsRunUUID, canCancel, progress, taskStatus);

            status.LoggableMessages = messages;

            statuses.Add(status);

            if (writeChildren)
            {
                job.flowchartRunRequest.ToList().ForEach(x =>
                {
                    var childStatus = new WorkStatus(x.flowchartRunUUID, progress, taskStatus);
                    childStatus.LoggableMessages = messages;

                    statuses.Add(childStatus);
                });
            }

            Add(statuses);
        }
예제 #3
0
        public void LogOperation(string customerShortName,
                                 string projectShortName,
                                 string operation,
                                 Guid flowchartRunId,
                                 TimeSpan span,
                                 int fallbackProgress)
        {
            var lastStatus = _workStatusProxy.GetLastStatus(customerShortName, projectShortName, flowchartRunId);
            var progress   = lastStatus != null ? lastStatus.Progress : fallbackProgress;

            var content = $"Operation { operation.ToString() } finished with a time of: {span.ToString("c")}.";
            var status  = new WorkStatus(flowchartRunId, progress, AnalyticsRunStatus.Running);

            status.LoggableMessages.Add(new WorkStatusMessage()
            {
                Content           = content,
                Severity          = TraceEventType.Information,
                Timestamp         = DateTime.Now,
                ViewLevelProperty = WorkStatusMessage.ViewLevel.Internal
            });

            _workStatusProxy.Add(status);
            LogOperationPCF(flowchartRunId, RunType.FlowchartRun, content);
        }