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

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

转载于:https://www.cnblogs.com/mol1995/p/7183782.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值