配置废弃

如何定义

  • 废弃是在每个类别的类上定义的。
  • 废弃条件是OQL申明,使用该类的任何字段,包括AttributeExternalField类型的字段
  • 废弃条件是从父类继承的,但是可以在子类上重新定义。
  • 如果没有在类上定义废弃条件,也没有在父上定义条件,则该类的对象永远不会被视为过时的。
       <obsolescence _delta="redefine">
          <condition><![CDATA[status='inactive']]></condition>
        </obsolescence>

状态未定义(= no value = ISNULL)的对象在默认情况下不视为作废。如果您希望将未定义状态视为过时,请使用以下条件:

        <obsolescence _delta="redefine">
          <condition><![CDATA[status='inactive' OR ISNULL(status)=1]]></condition>
        </obsolescence>

例子

基于对象状况:

   <classes><class id="Organization"><properties><obsolescence><condition>
        <![CDATA[status = 'inactive']]>
   </condition></obsolescence></properties></class><classes>

基于对象状态加上父级的状态(如果存在父级):

<classes><class id="Hypervisor"><properties><obsolescence><condition> <![CDATA[status = 'obsolete' OR (server_id != 0 AND server_id_obsolescence_flag)]]> </condition></obsolescence></properties></class><classes>

状况和延迟的组合:

 <classes><class id="Ticket"><properties><obsolescence><condition>
       <![CDATA[operational_status='closed' AND (close_date < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 15 MONTH),'%Y-%m-%d 00:00:00') OR (ISNULL(close_date) AND last_update < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 15 MONTH),'%Y-%m-%d 00:00:00')))]]>
   </condition></obsolescence></properties></class><classes>
 

原创链接:https://www.itophub.io/wiki/page?id=2_5_0%3Acustomization%3Aobsolescence


Configuring Obsolescence

How is it defined

  • Obsolescence is defined on a class per class basis.

  • A obsolescence condition is an OQL statement, using any field of the class, including those of type AttributeExternalField

  • Obsolescence condition are inherited from parent classes, but can be redefined on a child class.

  • If no obsolescence condition is defined on a class and none of its parent, then objects of that class are never considered as obsolete.

        <obsolescence _delta="redefine">
          <condition><![CDATA[status='inactive']]></condition>
        </obsolescence>

An object with its status undefined (= no value = ISNULL), is not considered as obsolete by default. If you want to have undefined status considered as obsolete then use this condition:

        <obsolescence _delta="redefine">
          <condition><![CDATA[status='inactive' OR ISNULL(status)=1]]></condition>
        </obsolescence>

Examples

Based on object status:

   <classes><class id="Organization"><properties><obsolescence><condition>
        <![CDATA[status = 'inactive']]>
   </condition></obsolescence></properties></class><classes>

Based on object status combined with status of a parent if parent exists :

   <classes><class id="Hypervisor"><properties><obsolescence><condition>
        <![CDATA[status = 'obsolete' OR (server_id != 0 AND server_id_obsolescence_flag)]]>
   </condition></obsolescence></properties></class><classes>

Combination of status and delay:

   <classes><class id="Ticket"><properties><obsolescence><condition>
       <![CDATA[operational_status='closed' AND (close_date < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 15 MONTH),'%Y-%m-%d 00:00:00') OR (ISNULL(close_date) AND last_update < DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 15 MONTH),'%Y-%m-%d 00:00:00')))]]>
   </condition></obsolescence></properties></class><classes>
标签:
由 superadmin 在 2020/08/27, 17:11 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司