Events are triggered when results are NOT saved to Oracle / Tracing DB / LU log files, ver. 2.26.1462
This commit is contained in:
@@ -10,6 +10,7 @@ using NHibernate;
|
||||
using NHibernate.Criterion;
|
||||
using Config.Entities;
|
||||
using TracingDB.Entities;
|
||||
using Events.Entities;
|
||||
|
||||
namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
{
|
||||
@@ -284,11 +285,56 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
|
||||
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
|
||||
opCompleted = true;
|
||||
if (SaveTracingRecords(batch) != Retv.OK) anyError = true;
|
||||
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
|
||||
|
||||
if (anyError)
|
||||
{
|
||||
try
|
||||
{
|
||||
NHibernate.ISession session = Events.DB.CreateSession();
|
||||
Events.DB.LoadSubscribers(session);
|
||||
|
||||
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
|
||||
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB: Číslo dávky={0}", batch.BatchNr),
|
||||
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB\r\nČíslo dávky = {0}", batch.BatchNr),
|
||||
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
|
||||
}
|
||||
|
||||
return Event.ErrorProcessingResults;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.ResultsWritten;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
|
||||
if (anyError)
|
||||
{
|
||||
try
|
||||
{
|
||||
NHibernate.ISession session = Events.DB.CreateSession();
|
||||
Events.DB.LoadSubscribers(session);
|
||||
|
||||
TBF.UiBridge.Bridge.TriggerEvent(session, Name, EventClass.ComputerResources, Severity.Error,
|
||||
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB: Číslo dávky={0}", batch.BatchNr),
|
||||
string.Format("Nepodarilo sa uložiť výsledky do sledovacej DB\r\nČíslo dávky = {0}", batch.BatchNr),
|
||||
SubscriberGroup.Metrology | SubscriberGroup.Maintenance | SubscriberGroup.Production);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
|
||||
}
|
||||
|
||||
return Event.ErrorProcessingResults;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Event.ResultsWritten;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user