码迷,mamicode.com
首页 > 其他好文 > 详细

CDM中遍历域及其约束条件、取值范围、引用它的项目

时间:2017-07-15 19:57:48      阅读:344      评论:0      收藏:0      [点我收藏+]

标签:val   sub   int   bat   表达式   name   domain   table   取值   

Option   Explicit
ValidationMode   =   True
InteractiveMode =   im_Batch
Dim   mdl   ‘当前model
‘获取当前活动model
Set   mdl   =   ActiveModel
If   (mdl   Is   Nothing)   Then
         MsgBox   "There   is   no   current   Model "
ElseIf   Not   mdl.IsKindOf(PdcDM.cls_Model)   Then ‘如果是处理pdm,这里换成PdPDM.cls_Model
         MsgBox   "The   current   model   is   not   an   Physical   Data   model. "
Else
         ProcessFolder   mdl
End   If
‘   This   routine   copy   name   into   comment   for   each   table,   each   column   and   each   view ‘   of   the   current   folder
Private   sub   ProcessFolder(folder)
‘域只在根目录Model下存在,所以不用递归查找下级目录的域,而且要找的话下级目录会报错
      output folder.ObjectType+" "+folder.name      
       Dim   dm ‘要处理的域
         for   each   dm   in  folder.domains ‘只有根目录为Model的域才有.domains属性        
               if   not   dm.isshortcut   then             ‘先处理表名
               output dm.code ‘域code
               output dm.LowValue ‘域的最小值约束
               output dm.HighValue ‘域的最大值约束
               output dm.ServerCheckExpression ‘域的正则表达式约束
      output dm.ListOfValues ‘域的取值范围

     dim ref
               for each ref in dm.dataitems ‘引用此domain的每个字段
               output ref.code+"   /"+ref.UsedBy ‘列举字段名称和所在表名
               next
            end if
        next
end   sub

CDM中遍历域及其约束条件、取值范围、引用它的项目

标签:val   sub   int   bat   表达式   name   domain   table   取值   

原文地址:http://www.cnblogs.com/mol1995/p/7183782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!