Message 1 of 2
Failure Handling : How to determine the Failure Definition Id to target
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
When we have a process failure during a transaction, how can we determine which built-in failure definition id to check for? For example, I have the following errors / warnings as shown in the image below;
I am trying to handle these using the class below;
public class WallWarningSwallower : IFailuresPreprocessor
{
public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor)
{
IList<FailureMessageAccessor> fmas = failuresAccessor.GetFailureMessages();
if (fmas.Count == 0)
{
return FailureProcessingResult.Continue;
}
bool isResolved = false;
foreach (FailureMessageAccessor fma in fmas)
{
if (
fma.GetFailureDefinitionId() == BuiltInFailures.JoinElementsFailures.CannotJoinElements ||
fma.GetFailureDefinitionId() == BuiltInFailures.JoinElementsFailures.CannotKeepJoined ||
fma.GetFailureDefinitionId() == BuiltInFailures.CutFailures.CannotCutInstanceOut ||
fma.GetFailureDefinitionId() == BuiltInFailures.OverlapFailures.DuplicateInstances
)
{
failuresAccessor.DeleteWarning(fma);
failuresAccessor.ResolveFailure(fma);
}
}
return FailureProcessingResult.Continue;
}
}
But still the warnings and errors are shown. So, how to handle these errors...?