cmmn-js-properties-panel-flowable 2.0.0-next.4 → 2.1.0
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.
|
@@ -51,6 +51,9 @@ var taskListenerProps = require('./parts/TaskListenerProps'),
|
|
|
51
51
|
// history time to live
|
|
52
52
|
var historyTimeToLive = require('./parts/HistoryTimeToLiveProps');
|
|
53
53
|
|
|
54
|
+
// the case and its start form
|
|
55
|
+
var caseStartProps = require('./parts/CaseStartProps');
|
|
56
|
+
|
|
54
57
|
// extensions
|
|
55
58
|
var extensionsProps = require('./parts/ExtensionsProps');
|
|
56
59
|
|
|
@@ -92,6 +95,15 @@ function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegis
|
|
|
92
95
|
nameProps(generalGroup, element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate);
|
|
93
96
|
|
|
94
97
|
|
|
98
|
+
var caseGroup = {
|
|
99
|
+
id: 'case',
|
|
100
|
+
label: translate('Case'),
|
|
101
|
+
entries: []
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
caseStartProps.caseProps(caseGroup, element, translate);
|
|
105
|
+
|
|
106
|
+
|
|
95
107
|
var detailsGroup = {
|
|
96
108
|
id: 'details',
|
|
97
109
|
label: translate('Details'),
|
|
@@ -136,6 +148,15 @@ function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegis
|
|
|
136
148
|
documentationProps(documentationGroup, element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate);
|
|
137
149
|
|
|
138
150
|
|
|
151
|
+
var startFormGroup = {
|
|
152
|
+
id: 'startForm',
|
|
153
|
+
label: translate('Start Form'),
|
|
154
|
+
entries: []
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
caseStartProps.startFormProps(startFormGroup, element, translate);
|
|
158
|
+
|
|
159
|
+
|
|
139
160
|
var historyTimeToLiveGroup = {
|
|
140
161
|
id: 'historyConfiguration',
|
|
141
162
|
label: translate('History Configuration'),
|
|
@@ -147,10 +168,12 @@ function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegis
|
|
|
147
168
|
return [
|
|
148
169
|
problemsGroup,
|
|
149
170
|
generalGroup,
|
|
171
|
+
caseGroup,
|
|
150
172
|
detailsGroup,
|
|
151
173
|
implementationGroup,
|
|
152
174
|
asyncGroup,
|
|
153
175
|
documentationGroup,
|
|
176
|
+
startFormGroup,
|
|
154
177
|
historyTimeToLiveGroup
|
|
155
178
|
];
|
|
156
179
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var entryFactory = require('../../../factory/EntryFactory'),
|
|
4
|
+
cmdHelper = require('../../../helper/CmdHelper');
|
|
5
|
+
|
|
6
|
+
var ModelUtil = require('@jylups/cmmn-js/lib/util/ModelUtil'),
|
|
7
|
+
getBusinessObject = ModelUtil.getBusinessObject,
|
|
8
|
+
isCasePlanModel = ModelUtil.isCasePlanModel;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function getCase(element) {
|
|
12
|
+
return getBusinessObject(element).$parent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getPlanModel(element) {
|
|
16
|
+
return getBusinessObject(element);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function textField(id, label, property, getTarget, translate, description) {
|
|
20
|
+
|
|
21
|
+
return entryFactory.textField({
|
|
22
|
+
id: id,
|
|
23
|
+
label: translate(label),
|
|
24
|
+
description: description && translate(description),
|
|
25
|
+
modelProperty: id,
|
|
26
|
+
|
|
27
|
+
get: function(element) {
|
|
28
|
+
var target = getTarget(element),
|
|
29
|
+
values = {};
|
|
30
|
+
|
|
31
|
+
values[id] = (target && target.get(property)) || '';
|
|
32
|
+
|
|
33
|
+
return values;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
set: function(element, values) {
|
|
37
|
+
var properties = {};
|
|
38
|
+
|
|
39
|
+
properties[property] = values[id] || undefined;
|
|
40
|
+
|
|
41
|
+
return cmdHelper.updateBusinessObject(element, getTarget(element), properties);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A checkbox for a Boolean attribute; the value Flowable uses when the
|
|
48
|
+
* attribute is not written is not written either.
|
|
49
|
+
*/
|
|
50
|
+
function checkbox(id, label, property, getTarget, translate, defaultValue, description) {
|
|
51
|
+
|
|
52
|
+
return entryFactory.checkbox({
|
|
53
|
+
id: id,
|
|
54
|
+
label: translate(label),
|
|
55
|
+
description: description && translate(description),
|
|
56
|
+
modelProperty: id,
|
|
57
|
+
|
|
58
|
+
get: function(element) {
|
|
59
|
+
var value = getTarget(element).get(property),
|
|
60
|
+
values = {};
|
|
61
|
+
|
|
62
|
+
values[id] = typeof value === 'boolean' ? value : defaultValue;
|
|
63
|
+
|
|
64
|
+
return values;
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
set: function(element, values) {
|
|
68
|
+
var value = !!values[id],
|
|
69
|
+
properties = {};
|
|
70
|
+
|
|
71
|
+
properties[property] = value === defaultValue ? undefined : value;
|
|
72
|
+
|
|
73
|
+
return cmdHelper.updateBusinessObject(element, getTarget(element), properties);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What Flowable reads on the case, shown with its case plan model: whether
|
|
81
|
+
* it starts asynchronously, the initiator variable, and who may start it.
|
|
82
|
+
*/
|
|
83
|
+
module.exports.caseProps = function(group, element, translate) {
|
|
84
|
+
|
|
85
|
+
if (!isCasePlanModel(element)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
group.entries.push(checkbox('case-async', 'Asynchronous Start', 'flowable:async', getCase, translate, false,
|
|
90
|
+
'Creates the case instance and starts its plan model in a job'));
|
|
91
|
+
|
|
92
|
+
group.entries.push(textField('case-initiatorVariableName', 'Initiator Variable', 'flowable:initiatorVariableName',
|
|
93
|
+
getCase, translate, 'Variable with the ID of the user who started the case'));
|
|
94
|
+
|
|
95
|
+
group.entries.push(textField('case-candidateStarterUsers', 'Candidate Starter Users',
|
|
96
|
+
'flowable:candidateStarterUsers', getCase, translate, 'Users who may start the case, comma separated'));
|
|
97
|
+
|
|
98
|
+
group.entries.push(textField('case-candidateStarterGroups', 'Candidate Starter Groups',
|
|
99
|
+
'flowable:candidateStarterGroups', getCase, translate, 'Groups who may start the case, comma separated'));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The start form of the case, on its case plan model.
|
|
105
|
+
*/
|
|
106
|
+
module.exports.startFormProps = function(group, element, translate) {
|
|
107
|
+
|
|
108
|
+
if (!isCasePlanModel(element)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
group.entries.push(textField('startForm-formKey', 'Form Key', 'flowable:formKey', getPlanModel, translate));
|
|
113
|
+
|
|
114
|
+
group.entries.push(textField('startForm-formFieldValidation', 'Form Field Validation',
|
|
115
|
+
'flowable:formFieldValidation', getPlanModel, translate, 'true, false or an expression'));
|
|
116
|
+
|
|
117
|
+
group.entries.push(checkbox('startForm-sameDeployment', 'Same Deployment', 'flowable:sameDeployment',
|
|
118
|
+
getPlanModel, translate, true, 'Takes the form from the deployment of the case; from any deployment when unchecked'));
|
|
119
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmmn-js-properties-panel-flowable",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A simple properties panel for cmmn-js with flowable namespaces",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint .",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@jylups/cmmn-js": "^0.22.0
|
|
31
|
+
"@jylups/cmmn-js": "^0.22.0",
|
|
32
32
|
"chai": "^4.1.2",
|
|
33
33
|
"diagram-js": "^15.29.0",
|
|
34
34
|
"eslint": "^5.2.0",
|
|
35
35
|
"eslint-plugin-bpmn-io": "^0.5.3",
|
|
36
|
-
"flowable-cmmn-moddle": "^1.
|
|
36
|
+
"flowable-cmmn-moddle": "^1.3.0",
|
|
37
37
|
"karma": "^4.1.0",
|
|
38
38
|
"karma-chrome-launcher": "^2.2.0",
|
|
39
39
|
"karma-firefox-launcher": "^1.0.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"selection-update": "^0.1.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@jylups/cmmn-js": "
|
|
61
|
+
"@jylups/cmmn-js": "^0.22.0",
|
|
62
62
|
"diagram-js": ">=4.0.0"
|
|
63
63
|
},
|
|
64
64
|
"files": [
|