@steedos/standard-process-approval 2.2.55-beta.16

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.
Files changed (61) hide show
  1. package/main/default/applications/.gitkeep +0 -0
  2. package/main/default/applications/process_automation.app.yml +49 -0
  3. package/main/default/client/action_field_updates.client.js +155 -0
  4. package/main/default/client/core.client.js +134 -0
  5. package/main/default/client/process.client.js +211 -0
  6. package/main/default/client/process_node.client.js +36 -0
  7. package/main/default/client/workflow_notifications.client.js +74 -0
  8. package/main/default/objectTranslations/action_field_updates.en/action_field_updates.en.objectTranslation.yml +69 -0
  9. package/main/default/objectTranslations/action_field_updates.zh-CN/action_field_updates.zh-CN.objectTranslation.yml +72 -0
  10. package/main/default/objectTranslations/process_definition.en/process_definition.en.objectTranslation.yml +150 -0
  11. package/main/default/objectTranslations/process_definition.zh-CN/process_definition.zh-CN.objectTranslation.yml +145 -0
  12. package/main/default/objectTranslations/process_flows.en/process_flows.en.objectTranslation.yml +41 -0
  13. package/main/default/objectTranslations/process_flows.zh-CN/process_flows.zh-CN.objectTranslation.yml +41 -0
  14. package/main/default/objectTranslations/process_flows_criteria.en/process_flows_criteria.en.objectTranslation.yml +38 -0
  15. package/main/default/objectTranslations/process_flows_criteria.zh-CN/process_flows_criteria.zh-CN.objectTranslation.yml +38 -0
  16. package/main/default/objectTranslations/process_flows_criteria_action.en/process_flows_criteria_action.en.objectTranslation.yml +47 -0
  17. package/main/default/objectTranslations/process_flows_criteria_action.zh-CN/process_flows_criteria_action.zh-CN.objectTranslation.yml +47 -0
  18. package/main/default/objectTranslations/process_instance.en/process_instance.en.objectTranslation.yml +63 -0
  19. package/main/default/objectTranslations/process_instance.zh-CN/process_instance.zh-CN.objectTranslation.yml +63 -0
  20. package/main/default/objectTranslations/process_instance_history.en/process_instance_history.en.objectTranslation.yml +109 -0
  21. package/main/default/objectTranslations/process_instance_history.zh-CN/process_instance_history.zh-CN.objectTranslation.yml +109 -0
  22. package/main/default/objectTranslations/process_instance_node.en/process_instance_node.en.objectTranslation.yml +59 -0
  23. package/main/default/objectTranslations/process_instance_node.zh-CN/process_instance_node.zh-CN.objectTranslation.yml +59 -0
  24. package/main/default/objectTranslations/process_node.en/process_node.en.objectTranslation.yml +120 -0
  25. package/main/default/objectTranslations/process_node.zh-CN/process_node.zh-CN.objectTranslation.yml +116 -0
  26. package/main/default/objectTranslations/workflow_notifications.en/workflow_notifications.en.objectTranslation.yml +41 -0
  27. package/main/default/objectTranslations/workflow_notifications.zh-CN/workflow_notifications.zh-CN.objectTranslation.yml +44 -0
  28. package/main/default/objectTranslations/workflow_rule.en/workflow_rule.en.objectTranslation.yml +53 -0
  29. package/main/default/objectTranslations/workflow_rule.zh-CN/workflow_rule.zh-CN.objectTranslation.yml +60 -0
  30. package/main/default/objects/process/approval/process_definition.action.js +65 -0
  31. package/main/default/objects/process/approval/process_definition.function.js +39 -0
  32. package/main/default/objects/process/approval/process_definition.object.yml +313 -0
  33. package/main/default/objects/process/approval/process_node.object.yml +267 -0
  34. package/main/default/objects/process/flows/process_flows.object.yml +48 -0
  35. package/main/default/objects/process/flows/process_flows_criteria.object.yml +46 -0
  36. package/main/default/objects/process/flows/process_flows_criteria_action.object.yml +56 -0
  37. package/main/default/objects/process/process_instance/process_instance.object.yml +65 -0
  38. package/main/default/objects/process/process_instance/process_instance_history.action.js +26 -0
  39. package/main/default/objects/process/process_instance/process_instance_history.object.yml +153 -0
  40. package/main/default/objects/process/process_instance/process_instance_node.object.yml +59 -0
  41. package/main/default/objects/workflow-actions/action_field_updates.action.js +33 -0
  42. package/main/default/objects/workflow-actions/action_field_updates.object.yml +197 -0
  43. package/main/default/objects/workflow-actions/workflow_notifications.action.js +33 -0
  44. package/main/default/objects/workflow-actions/workflow_notifications.object.yml +107 -0
  45. package/main/default/objects/workflow-actions/workflow_rule.action.js +33 -0
  46. package/main/default/objects/workflow-actions/workflow_rule.object.yml +112 -0
  47. package/main/default/permissionsets/.gitkeep +0 -0
  48. package/main/default/profiles/.gitkeep +0 -0
  49. package/main/default/tabs/.gitkeep +0 -0
  50. package/main/default/triggers/.gitkeep +0 -0
  51. package/main/default/triggers/action_field_updates.trigger.js +175 -0
  52. package/main/default/triggers/process_definition.trigger.js +132 -0
  53. package/main/default/triggers/process_instance_history.trigger.js +42 -0
  54. package/main/default/triggers/process_node.trigger.js +232 -0
  55. package/main/default/triggers/workflow_notifications.trigger.js +236 -0
  56. package/main/default/triggers/workflow_rule.trigger.js +96 -0
  57. package/package.json +16 -0
  58. package/package.service.js +75 -0
  59. package/public/.md +3 -0
  60. package/src/.md +3 -0
  61. package/webapp/.md +1 -0
@@ -0,0 +1,59 @@
1
+ name: process_instance_node
2
+ label: process_instance_node
3
+ hidden: true
4
+ icon: record
5
+ fields:
6
+ process_node_name:
7
+ type: text
8
+ is_name: true
9
+ process_instance:
10
+ type: lookup
11
+ reference_to: process_instance
12
+ process_node:
13
+ type: lookup
14
+ reference_to: process_node
15
+ node_status:
16
+ type: select
17
+ options:
18
+ - approved
19
+ - fault
20
+ - held
21
+ - no_response
22
+ - pending
23
+ - reassigned
24
+ - rejected
25
+ - removed
26
+ - started
27
+ completed_date:
28
+ type: datetime
29
+ label: Completed Date
30
+ last_actorId:
31
+ type: lookup
32
+ reference_to: users
33
+ elapsed_time_in_days:
34
+ type: number
35
+ precision: 18
36
+ scale: 0
37
+ elapsed_time_in_hours:
38
+ type: number
39
+ precision: 5
40
+ scale: 2
41
+ elapsed_time_in_minutes:
42
+ type: number
43
+ precision: 8
44
+ scale: 0
45
+ permission_set:
46
+ user:
47
+ allowCreate: false
48
+ allowDelete: false
49
+ allowEdit: false
50
+ allowRead: true
51
+ modifyAllRecords: false
52
+ viewAllRecords: true
53
+ admin:
54
+ allowCreate: false
55
+ allowDelete: false
56
+ allowEdit: false
57
+ allowRead: true
58
+ modifyAllRecords: false
59
+ viewAllRecords: true
@@ -0,0 +1,33 @@
1
+ const _ = require("underscore");
2
+ module.exports = {
3
+ customize: function (object_name, record_id, fields) {
4
+ var doc = Creator.odata.get(object_name, record_id);
5
+ var newDoc = {}
6
+ _.each(Creator.getObject(object_name).fields, function(v, k){
7
+ if(_.has(doc, k)){
8
+ newDoc[k] = doc[k]
9
+ }
10
+ })
11
+ delete newDoc.is_system;
12
+
13
+ let docName = doc.name
14
+ let docObjectName = doc.object_name
15
+
16
+ Creator.odata.insert(object_name, Object.assign(newDoc, {name: docName, object_name: docObjectName}), function(result, error){
17
+ if(result){
18
+ if(Session.get("object_name") === 'action_field_updates'){
19
+ FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
20
+ }else{
21
+ href = Creator.getObjectUrl(object_name, result._id);
22
+ window.open(href,'_blank','width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')
23
+ }
24
+ }
25
+ });
26
+ },
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
28
+ if(!record){
29
+ record = {}
30
+ }
31
+ return Creator.baseObject.actions.standard_new.visible() && record.is_system;
32
+ }
33
+ }
@@ -0,0 +1,197 @@
1
+ name: action_field_updates
2
+ label: Field Updates
3
+ icon: record
4
+ hidden: true
5
+ enable_inline_edit: false
6
+ # version: 2
7
+ enable_enhanced_lookup: true
8
+ fields:
9
+ name:
10
+ type: text
11
+ required: true
12
+ label:
13
+ type: text
14
+ required: true
15
+ is_name: true
16
+ object_name:
17
+ label: Object Name
18
+ type: lookup
19
+ optionsFunction: !!js/function |
20
+ function () {
21
+ return Steedos.getObjectsOptions();
22
+ }
23
+ target_object:
24
+ type: lookup
25
+ label: Object to Update
26
+ depend_on:
27
+ - object_name
28
+ optionsFunction: !!js/function |
29
+ function (doc) {
30
+ var object = Creator.objectsByName[doc.object_name];
31
+ if(object){
32
+ var _options = [{label: object.label, value: object.name}];
33
+ _.forEach(object.fields, function (field, fname) {
34
+ if(field && field.type === 'master_detail' && _.isString(field.reference_to)){
35
+ var referenceToObject = Creator.objectsByName[field.reference_to];
36
+ if(referenceToObject){
37
+ _options.push({
38
+ label: referenceToObject.label,
39
+ value: field.name,
40
+ });
41
+ }
42
+ }
43
+ });
44
+ return _options;
45
+ }
46
+ return [];
47
+ }
48
+ field_name:
49
+ label: Field to Update
50
+ type: lookup
51
+ showIcon: false
52
+ depend_on:
53
+ - object_name
54
+ - target_object
55
+ optionsFunction: !!js/function |
56
+ function (doc) {
57
+ var mainObjectName = null;
58
+ if(doc.target_object && doc.target_object != doc.object_name){
59
+ mainObjectName = Creator.objectsByName[doc.object_name].fields[doc.target_object].reference_to;
60
+ }else{
61
+ mainObjectName = doc.object_name;
62
+ }
63
+ var object = Creator.objectsByName[mainObjectName];
64
+ if(object){
65
+ var _options = [];
66
+ _.forEach(object.fields, function (field, fname) {
67
+ if(["formula", "summary", "autonumber"].indexOf(field.type) < 0){
68
+ /*公式、累计汇总、自动编号三种字段类型是只读的,不允许字段更新来变更其值*/
69
+ _options.push({
70
+ label: field.label,
71
+ value: field.name,
72
+ });
73
+ }
74
+ });
75
+ return _options;
76
+ }
77
+ return [];
78
+ }
79
+ operation:
80
+ type: lookup
81
+ showIcon: false
82
+ depend_on:
83
+ - field_name
84
+ - target_object
85
+ - object_name
86
+ optionsFunction: !!js/function |
87
+ function (doc) {
88
+ var mainObjectName = null;
89
+ if(doc.target_object && doc.target_object != doc.object_name){
90
+ mainObjectName = Creator.objectsByName[doc.object_name].fields[doc.target_object].reference_to;
91
+ }else{
92
+ mainObjectName = doc.object_name;
93
+ }
94
+ var object = Creator.objectsByName[mainObjectName];
95
+ if(object && doc.field_name){
96
+ var _options = [];
97
+ var field = object.fields[doc.field_name];
98
+ if(field && field.type != 'boolean'){
99
+ _options.push({
100
+ label: TAPi18n.__("action_field_updates_field_operation_options_null"),
101
+ value: 'null',
102
+ })
103
+ }
104
+ _options.push({
105
+ label: TAPi18n.__("action_field_updates_field_operation_options_formula"),
106
+ value: 'formula',
107
+ });
108
+ _options.push({
109
+ label: TAPi18n.__("action_field_updates_field_operation_options_literal"),
110
+ value: 'literal',
111
+ })
112
+ return _options;
113
+ }
114
+ return [];
115
+ }
116
+ # options:
117
+ # - label: 'Null'
118
+ # value: 'null'
119
+ # - label: 'Formula'
120
+ # value: 'formula'
121
+ # - label: 'PreviousValue'
122
+ # value: 'previous_value'
123
+ # - label: 'NextValue'
124
+ # value: 'next_value'
125
+ # - label: '特定值'
126
+ # value: 'literal'
127
+ formula:
128
+ type: textarea
129
+ is_wide: true
130
+ literal_value:
131
+ type: text
132
+ is_wide: true
133
+ label: Literal value
134
+ notify_assignee:
135
+ type: boolean
136
+ hidden: true
137
+ omit: true
138
+ label: 通知被分配人(仅修改拥有者时由此选项)
139
+ description:
140
+ label: Description
141
+ type: textarea
142
+ is_wide: true
143
+ reevaluate_on_change:
144
+ type: boolean
145
+ label: Re-evaluate Workflow Rules after Field Change
146
+ undirect:
147
+ type: boolean
148
+ label: 触发对象触发器、工作流规则、字段验证规则
149
+ # todo:
150
+ form:
151
+ beforeEdit: !!js/function |
152
+ function(){
153
+ Steedos.ProcessFieldUpdatesManager.changeSchema(this.doc, this.schema);
154
+ }
155
+ afterEdit: !!js/function |
156
+ function(){
157
+ Steedos.ProcessFieldUpdatesManager.changeSchema(this.doc, this.schema);
158
+ }
159
+ beforeView: !!js/function |
160
+ function(){
161
+ Steedos.ProcessFieldUpdatesManager.changeSchema(this.doc, this.schema);
162
+ }
163
+ list_views:
164
+ all:
165
+ label: All
166
+ filter_scope: space
167
+ filter_fields:
168
+ - object_name
169
+ columns:
170
+ - label
171
+ - object_name
172
+ - target_object
173
+ - field_name
174
+ - operation
175
+ - formula
176
+ # 该字段报错的值如果是 { o:xx, ids: xx} ,会导致点击相关表字段弹出这个窗口后立马报错、关闭弹窗, 所以暂时在列表上暂时隐藏该字段。
177
+ # - literal_value
178
+ - description
179
+ permission_set:
180
+ user:
181
+ allowCreate: false
182
+ allowDelete: false
183
+ allowEdit: false
184
+ allowRead: true
185
+ modifyAllRecords: false
186
+ viewAllRecords: true
187
+ admin:
188
+ allowCreate: true
189
+ allowDelete: true
190
+ allowEdit: true
191
+ allowRead: true
192
+ modifyAllRecords: true
193
+ viewAllRecords: true
194
+ actions:
195
+ customize:
196
+ label: Customize
197
+ on: record
@@ -0,0 +1,33 @@
1
+ const _ = require("underscore");
2
+ module.exports = {
3
+ customize: function (object_name, record_id, fields) {
4
+ var doc = Creator.odata.get(object_name, record_id);
5
+ var newDoc = {}
6
+ _.each(Creator.getObject(object_name).fields, function(v, k){
7
+ if(_.has(doc, k)){
8
+ newDoc[k] = doc[k]
9
+ }
10
+ })
11
+ delete newDoc.is_system;
12
+
13
+ let docName = doc.name
14
+ let docObjectName = doc.object_name
15
+
16
+ Creator.odata.insert(object_name, Object.assign(newDoc, {name: docName, object_name: docObjectName}), function(result, error){
17
+ if(result){
18
+ if(Session.get("object_name") === 'workflow_notifications'){
19
+ FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
20
+ }else{
21
+ href = Creator.getObjectUrl(object_name, result._id);
22
+ window.open(href,'_blank','width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')
23
+ }
24
+ }
25
+ });
26
+ },
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
28
+ if(!record){
29
+ record = {}
30
+ }
31
+ return Creator.baseObject.actions.standard_new.visible() && record.is_system;
32
+ }
33
+ }
@@ -0,0 +1,107 @@
1
+ name: workflow_notifications
2
+ label: Workflow Notification
3
+ icon: quick_text
4
+ hidden: true
5
+ enable_inline_edit: false
6
+ version: 2
7
+ fields:
8
+ name:
9
+ type: text
10
+ searchable: true
11
+ index: true
12
+ required: true
13
+ inlineHelpText: Can only contain lowercase letters and numbers, must start with a letter, cannot end with an underscore character or contain two consecutive underscore characters
14
+ label:
15
+ type: text
16
+ required: true
17
+ is_name: true
18
+ object_name:
19
+ label: Object Name
20
+ type: lookup
21
+ required: true
22
+ is_wide: true
23
+ optionsFunction: !!js/function |
24
+ function () {
25
+ return Steedos.getObjectsOptions();
26
+ }
27
+ title:
28
+ label: Title
29
+ type: textarea
30
+ is_wide: true
31
+ required: true
32
+ body:
33
+ label: Body
34
+ type: textarea
35
+ is_wide: true
36
+ required: true
37
+ assigned_users:
38
+ type: lookup
39
+ reference_to: users
40
+ multiple: true
41
+ is_wide: true
42
+ group: Select Assigned User
43
+ assigned_user_field:
44
+ type: lookup
45
+ multiple: true
46
+ is_wide: true
47
+ group: Select Assigned User
48
+ showIcon: false
49
+ depend_on:
50
+ - object_name
51
+ optionsFunction: !!js/function |
52
+ function (doc){
53
+ var object = Creator.objectsByName[doc.object_name];
54
+ var options = [];
55
+ if(object){
56
+ var userFields = _.filter(object.fields, function(field){
57
+ return (field.type === 'lookup' || field.type === 'master_detail') && field.omit != true && field.reference_to === 'users'
58
+ });
59
+ _.each(userFields, function(field){
60
+ options.push({label:field.label, value:field.name});
61
+ })
62
+ }
63
+ return options;
64
+ }
65
+ form:
66
+ beforeEdit: !!js/function |
67
+ function(){
68
+ Steedos.WorkflowNotificationsManager.changeSchema(this.doc, this.schema);
69
+ }
70
+ afterEdit: !!js/function |
71
+ function(){
72
+ Steedos.WorkflowNotificationsManager.changeSchema(this.doc, this.schema);
73
+ }
74
+ beforeView: !!js/function |
75
+ function(){
76
+ Steedos.WorkflowNotificationsManager.changeSchema(this.doc, this.schema);
77
+ }
78
+ list_views:
79
+ all:
80
+ label: All Notifications
81
+ filter_scope: space
82
+ columns:
83
+ - object_name
84
+ - name
85
+ - title
86
+ - body
87
+ - assigned_users
88
+ - assigned_user_field
89
+ permission_set:
90
+ user:
91
+ allowCreate: false
92
+ allowDelete: false
93
+ allowEdit: false
94
+ allowRead: true
95
+ modifyAllRecords: false
96
+ viewAllRecords: true
97
+ admin:
98
+ allowCreate: true
99
+ allowDelete: true
100
+ allowEdit: true
101
+ allowRead: true
102
+ modifyAllRecords: true
103
+ viewAllRecords: true
104
+ actions:
105
+ customize:
106
+ label: Customize
107
+ on: record
@@ -0,0 +1,33 @@
1
+ const _ = require("underscore");
2
+ module.exports = {
3
+ customize: function (object_name, record_id, fields) {
4
+ var doc = Creator.odata.get(object_name, record_id);
5
+ var newDoc = {}
6
+ _.each(Creator.getObject(object_name).fields, function(v, k){
7
+ if(_.has(doc, k)){
8
+ newDoc[k] = doc[k]
9
+ }
10
+ })
11
+ delete newDoc.is_system;
12
+
13
+ let docName = doc.name
14
+ let docObjectName = doc.object_name
15
+
16
+ Creator.odata.insert(object_name, Object.assign(newDoc, {name: docName, object_name: docObjectName}), function(result, error){
17
+ if(result){
18
+ if(Session.get("object_name") === 'workflow_rule'){
19
+ FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
20
+ }else{
21
+ href = Creator.getObjectUrl(object_name, result._id);
22
+ window.open(href,'_blank','width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')
23
+ }
24
+ }
25
+ });
26
+ },
27
+ customizeVisible: function(object_name, record_id, record_permissions, record){
28
+ if(!record){
29
+ record = {}
30
+ }
31
+ return Creator.baseObject.actions.standard_new.visible() && record.is_system;
32
+ }
33
+ }
@@ -0,0 +1,112 @@
1
+ name: workflow_rule
2
+ label: Workflow Rule
3
+ icon: maintenance_work_rule
4
+ hidden: true
5
+ version: 2
6
+ enable_enhanced_lookup: true
7
+ fields:
8
+ object_name:
9
+ label: Object Name
10
+ type: lookup
11
+ required: true
12
+ is_wide: true
13
+ optionsFunction: !!js/function |
14
+ function () {
15
+ return Steedos.getObjectsOptions();
16
+ }
17
+ name:
18
+ type: text
19
+ required: true
20
+ label:
21
+ type: text
22
+ required: true
23
+ is_name: true
24
+ active:
25
+ type: boolean
26
+ # hidden: true
27
+ trigger_type:
28
+ type: select
29
+ is_wide: true
30
+ required: true
31
+ firstOption: false
32
+ options:
33
+ - onCreateOnly
34
+ - onAllChanges
35
+ - onCreateOrTriggeringUpdate
36
+ defaultValue: onCreateOrTriggeringUpdate
37
+ formula:
38
+ type: textarea
39
+ is_wide: true
40
+ required: true
41
+ group: Rule Criteria
42
+ updates_field_actions:
43
+ group: Immediate Actions
44
+ type: lookup
45
+ multiple: true
46
+ label: Field Update
47
+ is_wide: true
48
+ reference_to: action_field_updates
49
+ reference_to_field: name
50
+ depend_on:
51
+ - object_name
52
+ filtersFunction: !!js/function |
53
+ function (filters, dependValues) {
54
+ if(dependValues && dependValues.object_name){
55
+ return "object_name eq '" + dependValues.object_name + "'";
56
+ }
57
+ }
58
+ workflow_notifications_actions:
59
+ group: Immediate Actions
60
+ type: lookup
61
+ multiple: true
62
+ label: Workflow Notification
63
+ is_wide: true
64
+ reference_to: workflow_notifications
65
+ reference_to_field: name
66
+ depend_on:
67
+ - object_name
68
+ filtersFunction: !!js/function |
69
+ function (filters, dependValues) {
70
+ if(dependValues && dependValues.object_name){
71
+ return "object_name eq '" + dependValues.object_name + "'";
72
+ }
73
+ }
74
+ # boolean_filter: # TODO 暂不支持
75
+ # type: text
76
+ # criteria: # TODO 暂不支持
77
+ # type: textarea
78
+ # time_triggers #TODO 暂不支持
79
+ description:
80
+ type: textarea
81
+ is_wide: true
82
+ list_views:
83
+ all:
84
+ label: All
85
+ filter_scope: space
86
+ filter_fields:
87
+ - object_name
88
+ columns:
89
+ - label
90
+ - object_name
91
+ - trigger_type
92
+ - active
93
+ - description
94
+ permission_set:
95
+ user:
96
+ allowCreate: false
97
+ allowDelete: false
98
+ allowEdit: false
99
+ allowRead: true
100
+ modifyAllRecords: false
101
+ viewAllRecords: true
102
+ admin:
103
+ allowCreate: true
104
+ allowDelete: true
105
+ allowEdit: true
106
+ allowRead: true
107
+ modifyAllRecords: true
108
+ viewAllRecords: true
109
+ actions:
110
+ customize:
111
+ label: Customize
112
+ on: record
File without changes
File without changes
File without changes
File without changes