到期通知

名称:到期通知

描述:即将到达日期时,获取通知

版本:1.0.1

发布:2019-02-18

itop-version-min:2.3.0

下载:https://store.itophub.io/en_US/products/combodo-notify-on-expiration

代码:combodo-notify-on-expiration

状态:稳定

特征

当即将到达到期日期时,此扩展名允许触发器通知使用。

  • 您可以定义各种到期规则,以用于不同的用途。针对合同和许可证到期,它可以与日期为属性的任何类一起使用。
  • 您可以为同一类别设置多个规则,并具有不同的通知期限,例如,时限的“提前3个月”和另一个“提前1个月”。如果需要,您甚至可以在时限之后的“ 5天”创建第三个。
  • 除非配置不同,否则到达到期的特定对象的通知仅会发生一次。
  • 通知消息可配置为任何标准触发动作。
  • 如果需要高级,则可以使用OQL在通知的范围中定义对象。

局限性

  • 到期通知仅每天发生一次。
  • 它不是为处理时间而设计的,仅用于日期。

要求

iTop 2.3.0或以上

修订记录

日期版本描述
2019-02-181.0.1修复菜单丢失和改进时间格式的鲁棒性
2019-01-101.0.0首个正式版本-已弃用
2018-03-280.1.0第一个发布

安装

使用标准安装流程file:///G:\wiki\page%3fid=extensions:installation 对于此扩展。

配置

一旦安装了新模块,请编辑配置文件config-itop.php并查找以下新部分:

 'combodo-notify-on-expiration' =>  (
                'time' => '03:00',
                'enabled' => true,
                'debug' => false,
        ),

以下设置可用于配置模块:

参数类型描述默认价值
时间小时:分钟流程应该启动的一天中的时间。03:00
已启用布尔值流程应该运行吗?true
调试布尔值CRON日志是否应包含调试信息?false

服务ron.php每天处理到期上的通知。确保计划将其运行在系统上。有关本章的更多信息后台任务.

要检查此服务的状况,请使用以下命令:

php webservices/cron.php --auth_user=admin --auth_pwd=admin --status_only=1

如果自安装扩展以来CRON至少没有运行过一次,则任务NotifyOnExpiration不会在此处列出。

用法

示例:在许可证过期前20天设置通知

  • 创建一个到期规则
  • 创建一个触发器
  • 创建一个通知

到期规则

该扩展在“服务管理”类别中引入了新的菜单项到期规则

要创建一个新的:

  • 给它任何你喜欢的名字,
  • 定义将在其上应用规则的类,期望使用类代码,例如。客户合同
  • 给它一个状况:激活以使cron在后台任务中执行此到期规则。
  • 通过在…选项1(简单)或…选项2(高级)字段集中填写字段来选择“已应用”选项:

简单

  • 定义要检查的日期,该日期必须是日期属性的代码,而不是标签。
  • 知期限是可配置的,它通过指定时限之前的天数来说明何时向触发器发送通知,

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationrulesimple.png

示例:设置 Class=Licence, Date to check=end_date 和“ Term of notice=20,则最终的OQL将为:

SELECT Licence WHERE end_date = DATE_ADD(CURRENT_DATE(), INTERVAL 20 DAY)

高级

  • 使用OQL查询定义OQL范围,以返回要在其上应用触发器的对象。输入OQL后,即使还记录了简单的选项,也将使用高级选项。
  • 使用高级模式,您可以在日期后使用触发器通知,这在简单模式下是不可能的。

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationruledetails.png

您可以为许可证,客户合同创建任意数量的到期规则,甚至可以为同一类创建多个规则,但使用不同的通知期限

预习

  • 如果运行到期规则,则可以随时检查哪些对象将是触发器。

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationrulepreview.png

触发器

使用添加的扩展名创建触发器:触发器(在到期上)

https://www.itophub.io/wiki/media?w=600&tok=e658fa&media=extensions%3Aexpirationtrigger.png

您可以使用OQL进一步过滤器:

SELECT Licence WHERE perpetual='no'

如果您有大量对象,则在到期规则中尽可能地提高过滤器的效率

通知

创建一个通知,定义谁应该接收它以及消息的正文
在标准之上占位符,此扩展程序还带来了:

占位符目的
$rule->name$到期规则的名称,该规则具有触发器此通知
$rule->description$期的到期规则的描述
$rule->term_of_notice$期规则定义的通知期限,该规则具有触发器和通知

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationnotification.png

将通知链接到上面创建的触发器。

常见问题解答

问:子菜单到期规则未出现在服务管理下
答:同样,尚不了解此问题的根因,如果没有该菜单,有很多创建到期规则的可能性。

  1. 在类ExpirationRule上,将仪表盘徽章添加到您的仪表板中:它提供了一种创建新规则并列出现有规则的方法。
  2. 使用菜单管理工具下的运行查询子菜单:SELECT ExpirationRule,它应该为您建议一个链接来创建一个新链接。
  3. 在菜单管理工具下,将子菜单全局搜索和搜索用于ExpirationRule类,它将列出现有规则,并列出供应以使用“新建”菜单创建一个规则

原文:https://www.itophub.io/wiki/page?id=extensions%3Acombodo-notify-on-expiration 


Notify on expiration

name:
Notify on expiration
description:
Get a notification when a date is about to be reached
version:
1.0.1
release:
2019-02-18
itop-version-min:
2.3.0
download:
https://store.itophub.io/en_US/products/combodo-notify-on-expiration
code:
combodo-notify-on-expiration
state:
stable

Features

This extension allow to trigger notification when an expiration date is about to be reached.

  • You can define various Expiration rules, for different usage. Targeted for Contract & License expiration, it can be used with any class having a date attribute.

  • You can set multiple rules for the same class with different term of notice, for example one '3 months ahead' and another 'one month before' the deadline. You can even create a third one '5 days after' the deadline if you want.

  • Notification for a particular object reaching Expiration, unless configured differently, will occur only once.

  • Notification message is configurable as any standard trigger/action.

  • For advanced need, you can define the objects in scope of the notification with an OQL.

Limitations

  • Expiration Notification occurs daily only.

  • It is not designed to handle time, only date.

Requirements

iTop 2.3.0 or above

Revision history

DateVersionDescription
2019-02-181.0.1Fix missing menu and improve robustness on time format
2019-01-101.0.0First official version - deprecated
2018-03-280.1.0First release

Installation

Use the Standard installation process for this extension.

Configuration

Once the new module has been installed, edit the configuration file config-itop.php and look for the following new section:

  'combodo-notify-on-expiration' =>  (
                'time' => '03:00',
                'enabled' => true,
                'debug' => false,
        ),

The following settings are available to configure the module:

ParameterTypeDescriptionDefault Value
timehour:minuteTime of the day, when the process should start.03:00
enabledbooleanShould the process run?true
debugbooleanShould the CRON log be enrich with debug information?false

The Notification on Expiration is handled by the service cron.php once a day. Make sure this one is scheduled to run on your system. More information in the chapter about Background tasks.

To check the status of this service, use the command:

php webservices/cron.php --auth_user=admin --auth_pwd=admin --status_only=1

The task NotifyOnExpiration will not be listed here if the CRON has not run at least once since the extension has been installed.

Usage

Example: Setup a notification 20 days before a License expires

  • Create a Expiration Rule

  • Create a Trigger

  • Create a Notification

Expiration Rule

The extension brings a new Menu entry Expiration rules in the “Service Management” category

To create a new one:

  • Give it any Name you like,

  • Define the Class on which the rule will be applied, a Class code is expected, for eg. CustomerContract

  • Give it a Status: Active to enable the cron to execute this Expiration rule in the Background task.

  • Choose an Applied option by filling the fields either in …option 1 (simple) or in …option 2 (advanced) fieldset:

Simple

  • Define the Date to check, which must be the code of a date attribute, not the label.

  • Term of notice is configurable and says when to trigger the notification, by specifying a number of days before the deadline,

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationrulesimple.png

Example: setting Class=Licence, Date to check=end_date and Term of notice=20 the resulting OQL will be:

SELECT Licence WHERE end_date = DATE_ADD(CURRENT_DATE(), INTERVAL 20 DAY)

Advanced

  • Define the OQL scope with an OQL query returning the objects on which to apply the trigger. As soon as an OQL is entered, the advanced option is used, even if the simple one is also documented.

  • With the advanced mode, you can trigger notification after a date, which is not possible in simple mode.

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationruledetails.png

You can create as many Expiration Rule as you want, for License, Customer Contract and even multiple for the same class but with a different term of notice

Preview

  • You can check anytime which objects would be trigger if the Expiration Rule is run.

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationrulepreview.png

Trigger

Create a Trigger using the extension added: Trigger (on expiration)

https://www.itophub.io/wiki/media?w=600&tok=e658fa&media=extensions%3Aexpirationtrigger.png

You may filter it further, with an OQL:

SELECT Licence WHERE perpetual='no'

If you have high volume of objects, it's more efficient to filter as much as possible in the Expiration Rule

Notification

Create a Notification, defining who should receive it and the body of the message
On top of the standard placeholders, this extension brings also:

PlaceholderPurpose
$rule->name$The name of the Expiration rule which has trigger this notification
$rule->description$The Description of the Expiration rule which has trigger this notification
$rule->term_of_notice$The Term of notice in days defined in the Expiration rule which has trigger this notification

https://www.itophub.io/wiki/media?media=extensions%3Aexpirationnotification.png

Link the Notification to the above created Trigger.

Troubleshooting / Q&A

Q: The sub-Menu Expiration rules does not appear under Service Management
A: Also the root cause of this issue is not understood yet, there are many possibilities to create Expiration rules without that Menu.

  1. Add to one of your Dashboards, a Dashlet Badge on class ExpirationRule: it provides a mean to create a new rule and list existing.

  2. Use under Menu Admin tools, the sub-menu Run queries: SELECT ExpirationRule it should propose you a link to create a new one.

  3. Use under Menu Admin tools, the sub-menu Universal Search and search for class ExpirationRule, it will list the existing rules and offer to create one with the New menu

标签:
由 superadmin 在 2020/08/27, 16:09 创建
    

需要帮助?

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

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