protected void OnWorkingStepCompleted(AllEnums.WorkingStepEndConditionTrigger trigger) { //Error Tracking if (m_ErrorFreeStep) { m_ErrorFreeCount++; } WorkingStepCompletedEventArgs e = new WorkingStepCompletedEventArgs(); e.WorkingStepNumber = CurrentWorkingStepNumber; e.WorkingStep = CurrentWorkingStep; e.LoadedWorkflow = LoadedWorkflow; e.WorkflowStartTime = m_StartTime; e.StepStartTime = m_StepStartTime; e.StepEndTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; e.StepDurationTime = e.StepEndTime - e.StepStartTime; EventHandler <WorkingStepCompletedEventArgs> handler = WorkingStepCompleted; if (handler != null) { handler(this, e); } //Trigger WorkflowCompleted event as soon as the last step (end step) is reached if (CurrentWorkingStepNumber == m_LoadedWorkflow.WorkingSteps.Count) { OnWorkflowCompleted(); } }
private void WorkingStepCompleted(object sender, WorkingStepCompletedEventArgs e) { logStep(e.LoadedWorkflow.Id + e.LoadedWorkflow.Name, WorkflowManager.Instance.ProducedPartsCounter, e.StepDurationTime, WorkflowManager.Instance.BoxErrorCounter, WorkflowManager.Instance.AssemblyErrorCounter, WorkflowManager.Instance.AdaptivityLevelId); }