@steedos/workflow_time_trigger 2.7.0-beta.9 → 2.7.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-11-12 13:18:28
4
- * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
- * @LastEditTime: 2023-11-25 13:03:30
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2024-04-01 17:51:34
6
6
  * @Description: 工作流时间触发器定时任务,用于将工作流规则中配置的时间触发器放入工作流操作执行队列
7
7
  */
8
8
  'use strict';
@@ -79,6 +79,7 @@ module.exports = {
79
79
  for (const doc of docs) {
80
80
  await queueObj.insert({
81
81
  'record_id': doc._id,
82
+ 'object_name': object_name,
82
83
  'updates_field_actions': updates_field_actions,
83
84
  'workflow_notifications_actions': workflow_notifications_actions,
84
85
  'workflow_outbound_messages_actions': workflow_outbound_messages_actions,
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-11-12 17:53:55
4
4
  * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
- * @LastEditTime: 2023-11-25 13:03:27
5
+ * @LastEditTime: 2024-04-02 09:48:57
6
6
  * @Description: 执行工作流时间触发器队列
7
7
  */
8
8
 
@@ -65,18 +65,24 @@ module.exports = {
65
65
  '_excuting': true // 正在执行,防止重复执行
66
66
  })
67
67
 
68
- const { record_id, updates_field_actions, workflow_notifications_actions, workflow_outbound_messages_actions } = doc
69
- // 字段更新
70
- if (updates_field_actions) {
71
- await objectql.runFieldUpdateActions(updates_field_actions, record_id);
72
- }
73
- // 消息提醒
74
- if (workflow_notifications_actions) {
75
- await objectql.runWorkflowNotifyActions(workflow_notifications_actions, record_id);
76
- }
77
- // 出站消息
78
- if (workflow_outbound_messages_actions) {
79
- await objectql.runWorkflowOutboundMessageActions(workflow_outbound_messages_actions, record_id);
68
+ const { record_id, object_name, updates_field_actions, workflow_notifications_actions, workflow_outbound_messages_actions } = doc
69
+
70
+
71
+ const record = await objectql.getObject(object_name).findOne(record_id)
72
+
73
+ if(record){
74
+ // 字段更新
75
+ if (updates_field_actions) {
76
+ await objectql.runFieldUpdateActions(updates_field_actions, record_id, null, record.space);
77
+ }
78
+ // 消息提醒
79
+ if (workflow_notifications_actions) {
80
+ await objectql.runWorkflowNotifyActions(workflow_notifications_actions, record_id, null, record.space);
81
+ }
82
+ // 出站消息
83
+ if (workflow_outbound_messages_actions) {
84
+ await objectql.runWorkflowOutboundMessageActions(workflow_outbound_messages_actions, record_id, null, record.space);
85
+ }
80
86
  }
81
87
 
82
88
  if (opt.keepDocs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/workflow_time_trigger",
3
- "version": "2.7.0-beta.9",
3
+ "version": "2.7.1-beta.1",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -9,9 +9,9 @@
9
9
  "access": "public"
10
10
  },
11
11
  "dependencies": {
12
- "@steedos/objectql": "2.7.0-beta.9",
12
+ "@steedos/objectql": "2.7.1-beta.1",
13
13
  "eval": "0.1.8",
14
14
  "node-schedule": "2.1.0"
15
15
  },
16
- "gitHead": "b9fad2d43fc0216dbcfcf965b7218590167d8f55"
16
+ "gitHead": "869f9bbc7438f42da31a8bfd91c83f088fe88079"
17
17
  }