通知操作
更新时间:2019-08-07
用户创建的通知可以设置在工作流的stage中,在此stage完成后,系统会向通知的地址发送通知消息。
新建通知
使用如下代码可以新建一个通知。
Java
1private void createNotification(BvwClient client) {
2 String createName = "test_notification";
3 String endpoint = "http://test.com/callback";
4 client.createNotification(createName, endpoint);
5}
通知名称在一个用户下不可重复。
删除通知
使用如下代码可以删除一个通知。
Java
1private void deleteNotification(BvwClient client, String notificationName) {
2 client.deleteNotification(notificationName);
3}
更新通知
使用如下代码可以更新一个通知信息。
Java
1private void updateNotification(BvwClient client, String notificationName, String endpoint) {
2 client.updateNotification(notificationName, endpoint);
3}
查询通知
使用如下代码可以查询一个通知信息。
Java
1private void getNotification(BvwClient client, String notificationName) {
2 NotificationGetResponse response = client.getNotification(notificationName);
3}
查询通知列表
使用如下代码可以查询通知列表信息。
Java
1private void listNotification(BvwClient client) {
2 NotificationListResponse response = client.listNotification();
3}
4
5private void listNotificationWithStatus(BvwClient client, NotificationStatus status) {
6 NotificationListResponse response = client.listNotification(NotificationStatus.ENABLE);
7}
查询通知列表的参数status可选,用于筛选通知状态。
停用通知
使用如下代码可以停用一个通知。
Java
1private void disableNotification(BvwClient client, String notificationName) {
2 client.disableWorkflow(notificationName);
3}
启用通知
使用如下代码可以启用一个通知。
Java
1private void enableNotification(BvwClient client, String notificationName) {
2 client.enableWorkflow(notificationName);
3}