/// <summary> /// This method starts the next job component /// </summary> /// <param name="prevSequence">The previous job component that finished (0 when the first has to start).</param> /// <param name="lastRunOK">Did the previous job run ok.</param> protected void KickOffComponent(int prevSequence, bool lastRunOK) { try { foreach (JobComponent comp in JobComponents) { if (comp.SequenceNumber > prevSequence && comp.IsEnabled) { if (lastRunOK || (!lastRunOK && !comp.AbortWhenPrevJobNotOK)) { history = new JobHistory(comp); JobHistoryMapper.InsertOrUpdate(Manager.GetSession(), history); comp.Start(); log.Info(string.Format("Start job component {0}", comp.Name)); return; } } } } catch (Exception ex) { log.Error("An error occured during kicking off a new component", ex); } }
/// <summary> /// Either creates or edits a JobHistory object in the database /// </summary> /// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param> /// <param name="obj">Object of type JobHistory</param> public static void InsertOrUpdate(IDalSession session, JobHistory obj) { session.InsertOrUpdate(obj); }