Job to update sync log table
static client void updateNotSynced2(Args _args)
{
SysVersionControlSynchronizeLog syncLog;
SysVersionControlSynchronizeBatchNum lastNum;
boolean entered = false;
//find last batch num
select firstOnly BatchNum from syncLog
order by syncLog.BatchNum desc;
lastNum = syncLog.BatchNum;
setPrefix('Numbers to process:');
//classes
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Classes*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for classes is: %1', lastNum));
}
//forms
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Forms*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
//tables
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Tables*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Tables is: %1', lastNum));
}
//extended data types
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Extended data types*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for EDTs is: %1', lastNum));
}
//base enums
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Base enums*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Enums is: %1', lastNum));
}
//menu items
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Menu items*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Menu items is: %1', lastNum));
}
//shared projects
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Projects*Shared*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Shared projects is: %1', lastNum));
}
//jobs
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Jobs*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Jobs is: %1', lastNum));
}
//SSRS Reports
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*SSRS Reports*Reports*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for SSRS reports is: %1', lastNum));
}
//Security roles
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Roles*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Roles is: %1', lastNum));
}
//Security duties
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Duties*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Duties is: %1', lastNum));
}
//Security privileges
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Privileges*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Privileges is: %1', lastNum));
}
//Menus
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Menus*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Menus is: %1', lastNum));
}
//Services
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Services*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Services is: %1', lastNum));
}
//Code permissions
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Code permissions*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Code permissions is: %1', lastNum));
}
//Workflow
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Workflow*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Workflows is: %1', lastNum));
}
//Parts
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Parts*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Parts is: %1', lastNum));
}
//config keys
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Configuration Keys*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for config keys is: %1', lastNum));
}
//maps
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Maps*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for maps is: %1', lastNum));
}
//Views
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Views*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Views is: %1', lastNum));
}
//Queries
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Queries*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data Sets*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*labels*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Macros*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Process Cycles*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Service Groups*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Visual Studio Projects*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Queries is: %1', lastNum));
}
}
{
SysVersionControlSynchronizeLog syncLog;
SysVersionControlSynchronizeBatchNum lastNum;
boolean entered = false;
//find last batch num
select firstOnly BatchNum from syncLog
order by syncLog.BatchNum desc;
lastNum = syncLog.BatchNum;
setPrefix('Numbers to process:');
//classes
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Classes*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for classes is: %1', lastNum));
}
//forms
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Forms*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
//tables
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Tables*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Tables is: %1', lastNum));
}
//extended data types
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Extended data types*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for EDTs is: %1', lastNum));
}
//base enums
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Base enums*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Enums is: %1', lastNum));
}
//menu items
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Menu items*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Menu items is: %1', lastNum));
}
//shared projects
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Projects*Shared*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Shared projects is: %1', lastNum));
}
//jobs
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Jobs*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Jobs is: %1', lastNum));
}
//SSRS Reports
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*SSRS Reports*Reports*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for SSRS reports is: %1', lastNum));
}
//Security roles
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Roles*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Roles is: %1', lastNum));
}
//Security duties
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Duties*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Duties is: %1', lastNum));
}
//Security privileges
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Privileges*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Privileges is: %1', lastNum));
}
//Menus
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Menus*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Menus is: %1', lastNum));
}
//Services
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Services*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Services is: %1', lastNum));
}
//Code permissions
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Code permissions*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Code permissions is: %1', lastNum));
}
//Workflow
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Workflow*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Workflows is: %1', lastNum));
}
//Parts
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Parts*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Parts is: %1', lastNum));
}
//config keys
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Configuration Keys*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for config keys is: %1', lastNum));
}
//maps
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Maps*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for maps is: %1', lastNum));
}
//Views
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data dictionary*Views*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Views is: %1', lastNum));
}
//Queries
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Queries*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Data Sets*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*labels*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Macros*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Security*Process Cycles*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Service Groups*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Forms is: %1', lastNum));
}
ttsBegin;
while select forUpdate syncLog
where syncLog.Processed == NoYes::No &&
syncLog.ItemPath like '*Visual Studio Projects*'
{
syncLog.BatchNum = lastNum + 1;
syncLog.update();
entered = true;
}
ttsCommit;
if (entered)
{
lastNum++;
entered = false;
info(strFmt('Batch number for Queries is: %1', lastNum));
}
}
Comments
Post a Comment