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:
		| @@ -739,6 +739,24 @@ namespace VEPROMS.CSLA.Library | |||||||
| 								content.ConvertTransitionToTextInGrid(null, null); | 								content.ConvertTransitionToTextInGrid(null, null); | ||||||
| 							content.Save(); | 							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; | ||||||
|  | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rich
					Rich