Failure Processing for multiple failures
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to handle multiple failures all in one event handler?
I was trying this:
public void FailureProcessing(object sender, FailuresProcessingEventArgs e) { FailuresAccessor failureAccessor = e.GetFailuresAccessor(); IList<FailureMessageAccessor> fmas = failureAccessor.GetFailureMessages(); if (fmas.Count == 0) { e.SetProcessingResult(FailureProcessingResult.Continue); return; } else { foreach (FailureMessageAccessor fma in fmas) { FailureDefinitionId id = fma.GetFailureDefinitionId(); if (id == BuiltInFailures.InaccurateFailures.InaccurateAreaLine) { failureAccessor.DeleteWarning(fma); } else if (id == BuiltInFailures.OverlapFailures.AreaBoundaryLinesOverlap) { failureAccessor.DeleteElements(fma.GetFailingElementIds().ToList()); } else { continue; } } e.SetProcessingResult(FailureProcessingResult.ProceedWithCommit); return; } }
It doesn't seem to work, as my transaction doesn't get commited. Any advice is welcome.
Link copied