Outside Transitions logic and annotations for unresolved transitions
This commit is contained in:
parent
efd8d900b2
commit
68d3ef8861
@ -16,7 +16,7 @@ namespace DataLoader
|
||||
{
|
||||
public partial class Loader
|
||||
{
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret)
|
||||
private Item AddStep(OleDbConnection cn, string StepType, string Textm, string Recid, string stpseq, string structtype, Item FromItem, DateTime dts, string userid, bool conv_caret, string pth)
|
||||
{
|
||||
Content content = null;
|
||||
Item item = null;
|
||||
@ -78,10 +78,11 @@ namespace DataLoader
|
||||
// use the unicode chars.
|
||||
char[] chrrotrn = { '\x252C', '\x2566' };
|
||||
tokrt = Textm.IndexOfAny(chrrotrn);
|
||||
_TransitionMigrationErrors = new List<string>();
|
||||
if (tokrt > -1)
|
||||
{
|
||||
txtdirty = true;
|
||||
stptext = MigrateTrans(cn, stptext, seqcvt, content);
|
||||
stptext = MigrateTrans(cn, stptext, seqcvt, content, pth);
|
||||
}
|
||||
if (txtdirty)
|
||||
{
|
||||
@ -89,6 +90,9 @@ namespace DataLoader
|
||||
//content.Save();
|
||||
}
|
||||
if (!content.IsSavable) ErrorRpt.ErrorReport(content);
|
||||
List<string> migrationerrors = null;
|
||||
if (_ContentMigrationErrors.ContainsKey(content.ContentID))
|
||||
migrationerrors = _ContentMigrationErrors[content.ContentID];
|
||||
content.Save();
|
||||
// check if already created thru new during transition migration...
|
||||
if (dicTrans_ItemIds.ContainsKey(ProcNumber + "|" + seqcvt))
|
||||
@ -101,9 +105,29 @@ namespace DataLoader
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item.Save();
|
||||
dicTrans_ItemIds.Remove(ProcNumber + "|" + seqcvt);
|
||||
dicTrans_MigrationErrors.Remove(ProcNumber + "|" + seqcvt);
|
||||
}
|
||||
else
|
||||
item = Item.MakeItem(FromItem, content, content.DTS, content.UserID);
|
||||
if (migrationerrors != null)
|
||||
{
|
||||
foreach (string str in migrationerrors)
|
||||
{
|
||||
ItemAnnotation ia = item.ItemAnnotations.Add(MigrationErrorType);
|
||||
ia.SearchText = str;
|
||||
}
|
||||
if (!item.IsSavable) ErrorRpt.ErrorReport(item);
|
||||
item.Save();
|
||||
}
|
||||
if (_TransitionMigrationErrors.Count > 0)
|
||||
{
|
||||
foreach (string str in _TransitionMigrationErrors)
|
||||
{
|
||||
if (!dicTrans_MigrationErrors.ContainsKey(str))
|
||||
dicTrans_MigrationErrors.Add(str, new List<Item>());
|
||||
dicTrans_MigrationErrors[str].Add(item);
|
||||
}
|
||||
}
|
||||
dicTrans_ItemDone[ProcNumber + "|" + seqcvt] = item;
|
||||
dicOldStepSequence[content] = seqcvt;
|
||||
}
|
||||
@ -251,7 +275,7 @@ namespace DataLoader
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret)
|
||||
private Item MigrateStep(OleDbConnection cn, DataTable dt, DataRowView drv, Item FromItem, bool conv_caret, string pth)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -259,7 +283,7 @@ namespace DataLoader
|
||||
Item item = AddStep(cn, drv["Type"].ToString()
|
||||
, (drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drv["CStep"].ToString() + drv["CSequence"].ToString(), "S", FromItem // was str
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret);
|
||||
, GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString(), conv_caret, pth);
|
||||
//Content cont = Content.MakeContent(null,(drv["textm"] == DBNull.Value ? drv["Text"].ToString() : drv["Textm"].ToString()),drv["Type"]+20000,null,null,
|
||||
// GetDTS(drv["Date"].ToString(), drv["Time"].ToString()), drv["Initials"].ToString());
|
||||
//Item item = Item.MakeItem(FromItem, cont, cont.DTS, cont.UserID);
|
||||
@ -312,7 +336,7 @@ namespace DataLoader
|
||||
, (drvs["textm"] == DBNull.Value ? drvs["Text"].ToString() : drvs["Textm"].ToString())
|
||||
, drv["Recid"].ToString(), drvs["CStep"].ToString() + drvs["CSequence"].ToString()
|
||||
, GetStructType(drvs["sequence"].ToString()), FrItem
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret);
|
||||
, GetDTS(drvs["Date"].ToString(), drvs["Time"].ToString()), drvs["Initials"].ToString(), conv_caret, pth);
|
||||
|
||||
if (FrType > 0 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user