public bool OfflineRunnerExecutionLog(GingerExecutionEngine runner, string logFolderPath, int runnerCount = 0) { try { mBusinessFlowCounter = 0; ObservableList <BusinessFlow> listBF = runner.BusinessFlows; int counter = 1; foreach (BusinessFlow bf in listBF) { string reportpath = Path.Combine(logFolderPath, counter.ToString() + " " + folderNameNormalazing(bf.Name)); System.IO.Directory.CreateDirectory(reportpath); this.ExecutionLogBusinessFlowsCounter = counter; ((ExecutionLogger)mExecutionLogger).ExecutionLogBusinessFlowsCounter = counter; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! runner.CalculateBusinessFlowFinalStatus(bf, true); if (bf.RunStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed && bf.RunStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed && bf.RunStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped) { continue; } runner.SetBFOfflineData(bf, this, reportpath); mBusinessFlowCounter++; runner.ExecutionLogFolder = Path.Combine(logFolderPath, mBusinessFlowCounter + " " + folderNameNormalazing(bf.Name)); counter++; } RunnerRunEnd(meventtime, runner.GingerRunner, logFolderPath, runnerCount, true); // GingerEnd(runner, logFolderPath, runnerCount); // !!!!!!!!!!!!!!!!!!!!! FIXME runner.ExecutionLogFolder = string.Empty; return(true); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Execution Logger Failed to do Offline BusinessFlow Execution Log", ex); return(false); } }
private void ShowStatus() { // Why we create new GR? !!! GingerExecutionEngine Gr = new GingerExecutionEngine(new GingerRunner()); foreach (Activity activity in mContext.BusinessFlow.Activities) { Gr.CalculateActivityFinalStatus(activity); } Gr.CalculateBusinessFlowFinalStatus(mContext.BusinessFlow); StatusLabel.Content = mContext.BusinessFlow.RunStatus; StatusLabel.Foreground = General.GetStatusBrush(mContext.BusinessFlow.RunStatus); }
// remove to GinngerRunner.SetBFOfflineData public bool OfflineBusinessFlowExecutionLog(BusinessFlow businessFlow, string logFolderPath) { try { //handle root directory if (Directory.Exists(logFolderPath)) { executionLoggerHelper.CleanDirectory(logFolderPath); } else { Directory.CreateDirectory(logFolderPath); } GingerExecutionEngine Gr = new GingerExecutionEngine(new GingerRunner()); mCurrentBusinessFlow = businessFlow; businessFlow.OffilinePropertiesPrep(logFolderPath); System.IO.Directory.CreateDirectory(businessFlow.ExecutionLogFolder); foreach (Activity activity in businessFlow.Activities) { ActivitiesGroup currentActivityGroup = businessFlow.ActivitiesGroups.Where(x => x.ActivitiesIdentifiers.Select(z => z.ActivityGuid).ToList().Contains(activity.Guid)).FirstOrDefault(); if (currentActivityGroup != null) { currentActivityGroup.ExecutionLogFolder = logFolderPath; switch (currentActivityGroup.ExecutionLoggerStatus) { case executionLoggerStatus.NotStartedYet: ActivityGroupStart(meventtime, currentActivityGroup); break; } } Gr.CalculateActivityFinalStatus(activity); if (activity.GetType() == typeof(IErrorHandler)) { continue; } if (activity.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed && activity.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed && activity.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped) { continue; } mCurrentActivity = activity; activity.OfflinePropertiesPrep(businessFlow.ExecutionLogFolder, businessFlow.ExecutionLogActivityCounter, ExtensionMethods.folderNameNormalazing(activity.ActivityName)); System.IO.Directory.CreateDirectory(activity.ExecutionLogFolder); foreach (Act action in activity.Acts) { if (action.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed && action.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed && action.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped && action.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.FailIgnored) { continue; } activity.ExecutionLogActionCounter++; action.ExecutionLogFolder = Path.Combine(activity.ExecutionLogFolder, activity.ExecutionLogActionCounter + " " + ExtensionMethods.folderNameNormalazing(action.Description)); System.IO.Directory.CreateDirectory(action.ExecutionLogFolder); ActionEnd(meventtime, action, true); } ActivityEnd(meventtime, activity, true); businessFlow.ExecutionLogActivityCounter++; } Gr.SetActivityGroupsExecutionStatus(businessFlow, true); Gr.CalculateBusinessFlowFinalStatus(businessFlow); BusinessFlowEnd(meventtime, businessFlow, true); businessFlow.ExecutionLogFolder = string.Empty; return(true); } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Execution Logger Failed to do Offline BusinessFlow Execution Log", ex); return(false); } }