Search This Blog

Monday, September 19, 2011

BP Deviation Update for AOT while Upgrading

Following job is used to update the methods with the BP Deviation documented while upgrading from one version to another version.
This job is used to update for tables,Classes,Views,FormMethods,ReportMethods.

This wont update at the datasource for forms or reports level.

static void krishh_AddBPDeviationDocumented(Args _args)
{
    TreeNode            node;

    TreeNode            childNode;
    TreeNodeIterator    nodeIt;
    FilePath            path;
    str filter,filter1;
    str BPFix='//BP Deviation Documented';
    str firstLine;
    List listSource=new List(Types::String);
    ListIterator listIterator;
    str BPFixFind='//BP Deviation Documented*';

    ;

    filter='*display*';
    filter1='*edit*';

    path        = @'\Data dictionary\tables\CustTable';
   // path        = @'\Data dictionary\views\CustTable';
    //path=@'\Classes';
    //path=@\Forms';
    path += '\\Methods';

    node        = TreeNode::findNode(path);
    nodeIt      = node.AOTiterator();

    childNode   = nodeIt.next();
    if(childNode.AOTLayer()==UtilEntryLevel::var)
    {
        while(childNode)
        {
            listSource=Global::strSplit(childNode.AOTgetSource(),'()');
            listIterator=new listIterator(listSource);
            if(listIterator.more())
            {
               if(firstLine like BPFixFind)
               {
                   info(strFmt('Table.Method:%1.%2 is already BP Deviated',childNode.AOTparent(),childNode.AOTname()));
               }
               else
                {
                  if((firstLine like filter) || (firstLine like filter1))
                    {
                        childNode.AOTsetSource(BPFix+"\n"+ childNode.AOTgetSource());
                        childNode.AOTcompile();
                        childNode.AOTsave();
                    }
                }
            }
            childNode = nodeIt.next();
        }
    }
}

No comments:

Post a Comment

Thanks for visiting my blog,
I will reply for your comment within 48 hours.

Thanks,
krishna.