Added Logic to handle and report Transition Conversion errors.
Corrected logic to translate TranType 2 transitions when Range location is less than the To location. Corrected logic for translating dates.
This commit is contained in:
parent
5a81462bf7
commit
891615bbc1
@ -27,6 +27,7 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
class TransitionFixer
|
class TransitionFixer
|
||||||
{
|
{
|
||||||
|
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
public event TransitionFixerEvent StatusChanged;
|
public event TransitionFixerEvent StatusChanged;
|
||||||
private void OnStatusChanged(object sender, TransitionFixerEventArgs args)
|
private void OnStatusChanged(object sender, TransitionFixerEventArgs args)
|
||||||
{
|
{
|
||||||
@ -107,6 +108,7 @@ namespace DataLoader
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
Console.WriteLine("{0} {1}", ex.GetType().Name, ex.Message);
|
||||||
|
_MyLog.WarnFormat("Transition Conversion Error: {0}", ex.Message);
|
||||||
}
|
}
|
||||||
// Added for transitions to un-numbered steps
|
// Added for transitions to un-numbered steps
|
||||||
if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
||||||
|
@ -73,7 +73,7 @@ namespace DataLoader
|
|||||||
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
|
||||||
itype = -1;
|
itype = -1;
|
||||||
}
|
}
|
||||||
DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).Trim());
|
DateTime dts = GetDTS(MakeDate(dti.Substring(0, 8).Trim()), dti.Substring(8, 5).TrimEnd());
|
||||||
|
|
||||||
// if it's in the dictionary of structure elements already migrated, just use this
|
// if it's in the dictionary of structure elements already migrated, just use this
|
||||||
// structure id, or if it's in the dictionary of structure elements that have
|
// structure id, or if it's in the dictionary of structure elements that have
|
||||||
@ -134,22 +134,18 @@ namespace DataLoader
|
|||||||
if (dr2 != null)
|
if (dr2 != null)
|
||||||
{
|
{
|
||||||
string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString();
|
string thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString();
|
||||||
// Range transitions that are type 2 are called 'and' transitions. These should extend to the
|
|
||||||
// last sibling. In data, these are represented with the SQL database field in the transitions
|
// Range transitions that are type 2 are called 'AND' transitions.
|
||||||
// table 'IsRange' == 2, and the toid == rangeid. In the content record, the link is
|
// Example: Continue with steps 5b, 5c and 5d.
|
||||||
// TransitionRange:[type] [tranid] [toid] [rangeid] -> and the toid == rangeid
|
// if the second key is greater than the first key, then the transition terminates
|
||||||
// The following was commented out for the Shearon Harris data migration because the
|
// at the location specified in the second key.
|
||||||
// migrated data did not match 16bit. One example can be found EOPS/ECA-0.0, step 47, RNO.
|
// If the second key is less than or equal the first key, the transition extends
|
||||||
// 16bit had Steps 47b AND c; 32bit had Steps 47b, c, d, e, f AND g before this code was
|
// to the last sibling of the first key.
|
||||||
// commented out (June 2013).
|
// In data, these are represented with the SQL database field in the transitions
|
||||||
//if (itype == 2)
|
// table 'IsRange' == 2, toid and rangeid. In the content record, the link is
|
||||||
//{
|
// TransitionRange:[type] [tranid] [toid] [rangeid].
|
||||||
// if (dr["TOSEQUENCE"].ToString().Length > 3 &&
|
|
||||||
// dr["TOSEQUENCE"].ToString().Substring(0, 2) == dr2["TOSEQUENCE"].ToString().Substring(0, 2))
|
if (itype == 2 && thekey.CompareTo(thekey2) >= 0) thekey2 = thekey;
|
||||||
// thekey2 = thekey;
|
|
||||||
// else
|
|
||||||
// thekey2 = dr2["TONUMBER"].ToString() + "|" + dr2["TOSEQUENCE"].ToString().Substring(0, 3);
|
|
||||||
//}
|
|
||||||
if (dicTrans_ItemDone.ContainsKey(thekey2))
|
if (dicTrans_ItemDone.ContainsKey(thekey2))
|
||||||
{
|
{
|
||||||
toItem2 = dicTrans_ItemDone[thekey2];
|
toItem2 = dicTrans_ItemDone[thekey2];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user