version control through job

static void versionctrl(Args _args)
{
SysVersionControlSystem vcsSys;
SysVersionControllable controllable;

UtilElements UtilElementsLocal,parent;
TreeNode treenode;
;

vcsSys = versionControl.parmSysVersionControlSystem();

if(!vcsSys)
{
info("Version control not enabled");
return;
}

while select * from UtilElementsLocal
where UtilElementsLocal.recordType == UtilElementType::Table
&& UtilElementsLocal.utilLevel == global::currentAOLayer()
{

parent=xUtilElements::parentElement(UtilElementsLocal);

treenode=SysTreeNode::findNodeInLayer(parent.recordType, parent.name, 0, curLayer);

if(!treenode)
continue;
controllable = SysTreeNode::newTreeNode(treeNode);
if(!controllable)
continue;

if(vcsSys.allowCreate(controllable))
{

vcsSys.commandAdd(controllable);
}
}
}

 

I tried to do by above job, when I'm running for the first time it added the user layer tables to version control after that I did checkin to those tables manually.

Now when i tried to run the job again to add the tables, its not working correctly.

Is there any error?

Thanks in advance.

Related
Recommended