B2018-043 The code to fix Invalid Transitions in procedure text was getting hung in an infinite loop in the Admin Tools or when these step were opened in the editor. I added some code to exit from the loop if some of the tokens are missing.

This commit is contained in:
Rich 2018-03-07 19:04:32 +00:00
parent 38f005f9c2
commit 7164ae98ef

View File

@ -739,6 +739,24 @@ namespace VEPROMS.CSLA.Library
content.ConvertTransitionToTextInGrid(null, null);
content.Save();
}
else // B2018-043 Eliminate infinite loop for invalid transition structure
{
bool hasAnnotation = false;
AnnotationType myType = AnnotationType.GetByNameOrCreate("Link Converted To Text");
foreach (AnnotationInfo anot in itemInfo.ItemAnnotations)
{
if (anot.TypeID == myType.TypeID && anot.SearchText == "Invalid Transition Format")
hasAnnotation = true;
}
if (!hasAnnotation)
{
using (Item myItem = itemInfo.Get())
{
Annotation.MakeAnnotation(myItem, myType, "", "Invalid Transition Format", null);
}
}
break;
}
}
}
}