Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
e813005b
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e813005b
编写于
12月 01, 2015
作者:
T
Tijs Rademakers
提交者:
Joram Barrez
12月 18, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Porting
https://github.com/Activiti/Activiti/commit/db5a2026249467462228e90199ce50455659c3e1
to v6
上级
bb376da4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
154 addition
and
27 deletion
+154
-27
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
.../java/org/activiti/editor/constants/StencilConstants.java
+3
-1
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/BaseBpmnJsonConverter.java
...editor/language/json/converter/BaseBpmnJsonConverter.java
+18
-7
modules/activiti-ui/activiti-app/src/main/webapp/editor/editor-app/configuration/properties-form-properties-controller.js
...pp/configuration/properties-form-properties-controller.js
+97
-12
modules/activiti-ui/activiti-app/src/main/webapp/editor/editor-app/configuration/properties/form-properties-popup.html
...r-app/configuration/properties/form-properties-popup.html
+30
-6
modules/activiti-ui/activiti-app/src/main/webapp/editor/i18n/en.json
...iviti-ui/activiti-app/src/main/webapp/editor/i18n/en.json
+6
-1
未找到文件。
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
浏览文件 @
e813005b
...
...
@@ -177,7 +177,9 @@ public interface StencilConstants {
final
String
PROPERTY_FORM_READABLE
=
"readable"
;
final
String
PROPERTY_FORM_WRITABLE
=
"writable"
;
final
String
PROPERTY_FORM_ENUM_VALUES
=
"enumValues"
;
final
String
PROPERTY_FORM_ENUM_VALUES_NAME
=
"name"
;
final
String
PROPERTY_FORM_ENUM_VALUES_ID
=
"id"
;
final
String
PROPERTY_DATA_PROPERTIES
=
"dataproperties"
;
final
String
PROPERTY_DATA_ID
=
"dataproperty_id"
;
final
String
PROPERTY_DATA_NAME
=
"dataproperty_name"
;
...
...
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/BaseBpmnJsonConverter.java
浏览文件 @
e813005b
...
...
@@ -419,7 +419,8 @@ public abstract class BaseBpmnJsonConverter implements EditorJsonConstants, Sten
ArrayNode
valuesNode
=
objectMapper
.
createArrayNode
();
for
(
FormValue
formValue
:
property
.
getFormValues
())
{
ObjectNode
valueNode
=
objectMapper
.
createObjectNode
();
valueNode
.
put
(
"value"
,
formValue
.
getName
());
valueNode
.
put
(
PROPERTY_FORM_ENUM_VALUES_NAME
,
formValue
.
getName
());
valueNode
.
put
(
PROPERTY_FORM_ENUM_VALUES_ID
,
formValue
.
getId
());
valuesNode
.
add
(
valueNode
);
}
propertyItemNode
.
put
(
PROPERTY_FORM_ENUM_VALUES
,
valuesNode
);
...
...
@@ -515,19 +516,29 @@ public abstract class BaseBpmnJsonConverter implements EditorJsonConstants, Sten
formProperty
.
setType
(
getValueAsString
(
PROPERTY_FORM_TYPE
,
formNode
));
formProperty
.
setExpression
(
getValueAsString
(
PROPERTY_FORM_EXPRESSION
,
formNode
));
formProperty
.
setVariable
(
getValueAsString
(
PROPERTY_FORM_VARIABLE
,
formNode
));
if
(
"date"
.
equalsIgnoreCase
(
formProperty
.
getType
()))
{
formProperty
.
setDatePattern
(
getValueAsString
(
PROPERTY_FORM_DATE_PATTERN
,
formNode
));
}
else
if
(
"enum"
.
equalsIgnoreCase
(
formProperty
.
getType
()))
{
JsonNode
enumValuesNode
=
formNode
.
get
(
PROPERTY_FORM_ENUM_VALUES
);
if
(
enumValuesNode
!=
null
)
{
List
<
FormValue
>
formValueList
=
new
ArrayList
<
FormValue
>();
for
(
JsonNode
enumNode
:
enumValuesNode
)
{
if
(
enumNode
.
get
(
"value"
)
!=
null
&&
enumNode
.
get
(
"value"
).
isNull
()
==
false
)
{
FormValue
formValue
=
new
FormValue
();
formValue
.
setId
(
enumNode
.
get
(
"value"
).
asText
());
formValue
.
setName
(
enumNode
.
get
(
"value"
).
asText
());
formValueList
.
add
(
formValue
);
}
if
(
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_ID
)
!=
null
&&
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_ID
).
isNull
()
==
false
&&
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_NAME
)
!=
null
&&
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_NAME
).
isNull
()
==
false
)
{
FormValue
formValue
=
new
FormValue
();
formValue
.
setId
(
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_ID
).
asText
());
formValue
.
setName
(
enumNode
.
get
(
PROPERTY_FORM_ENUM_VALUES_NAME
).
asText
());
formValueList
.
add
(
formValue
);
}
else
if
(
enumNode
.
get
(
"value"
)
!=
null
&&
enumNode
.
get
(
"value"
).
isNull
()
==
false
)
{
FormValue
formValue
=
new
FormValue
();
formValue
.
setId
(
enumNode
.
get
(
"value"
).
asText
());
formValue
.
setName
(
enumNode
.
get
(
"value"
).
asText
());
formValueList
.
add
(
formValue
);
}
}
formProperty
.
setFormValues
(
formValueList
);
}
...
...
modules/activiti-ui/activiti-app/src/main/webapp/editor/editor-app/configuration/properties-form-properties-controller.js
浏览文件 @
e813005b
...
...
@@ -42,9 +42,26 @@ angular.module('activitiModeler').controller('KisBpmFormPropertiesPopupCtrl',
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happended
$scope
.
formProperties
=
angular
.
copy
(
$scope
.
property
.
value
.
formProperties
);
for
(
var
i
=
0
;
i
<
$scope
.
formProperties
.
length
;
i
++
)
{
var
formProperty
=
$scope
.
formProperties
[
i
];
if
(
formProperty
.
enumValues
&&
formProperty
.
enumValues
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
formProperty
.
enumValues
.
length
;
j
++
)
{
var
enumValue
=
formProperty
.
enumValues
[
j
];
if
(
!
enumValue
.
id
&&
!
enumValue
.
name
&&
enumValue
.
value
)
{
enumValue
.
id
=
enumValue
.
value
;
enumValue
.
name
=
enumValue
.
value
;
}
}
}
}
}
else
{
$scope
.
formProperties
=
[];
}
$scope
.
selectedProperties
=
[];
$scope
.
selectedEnumValues
=
[];
$scope
.
translationsRetrieved
=
false
;
...
...
@@ -75,6 +92,18 @@ angular.module('activitiModeler').controller('KisBpmFormPropertiesPopupCtrl',
{
field
:
'
name
'
,
displayName
:
$scope
.
labels
.
nameLabel
},
{
field
:
'
type
'
,
displayName
:
$scope
.
labels
.
typeLabel
}]
};
$scope
.
enumGridOptions
=
{
data
:
'
selectedProperties[0].enumValues
'
,
enableRowReordering
:
true
,
headerRowHeight
:
28
,
multiSelect
:
false
,
keepLastSelected
:
false
,
selectedItems
:
$scope
.
selectedEnumValues
,
columnDefs
:
[{
field
:
'
id
'
,
displayName
:
$scope
.
labels
.
idLabel
},
{
field
:
'
name
'
,
displayName
:
$scope
.
labels
.
nameLabel
}]
}
$scope
.
gridOptions
.
onRegisterApi
=
function
(
gridApi
)
{
//set gridApi on scope
...
...
@@ -97,23 +126,12 @@ angular.module('activitiModeler').controller('KisBpmFormPropertiesPopupCtrl',
// Check enum. If enum, show list of options
if
(
$scope
.
selectedProperty
.
type
===
'
enum
'
)
{
$scope
.
selectedPropert
y
.
enumValues
=
[{
value
:
'
value 1
'
},
{
value
:
'
v
alue 2
'
}];
$scope
.
selectedPropert
ies
[
0
].
enumValues
=
[
{
id
:
'
value1
'
,
name
:
'
Value 1
'
},
{
id
:
'
value2
'
,
name
:
'
V
alue 2
'
}];
}
else
{
delete
$scope
.
selectedProperty
.
enumValues
;
}
};
// Click handler for + button after enum value
var
valueIndex
=
3
;
$scope
.
addEnumValue
=
function
(
index
)
{
$scope
.
selectedProperty
.
enumValues
.
splice
(
index
+
1
,
0
,
{
value
:
'
value
'
+
valueIndex
++
});
};
// Click handler for - button after enum value
$scope
.
removeEnumValue
=
function
(
index
)
{
$scope
.
selectedProperty
.
enumValues
.
splice
(
index
,
1
);
};
// Click handler for add button
var
propertyIndex
=
1
;
$scope
.
addNewProperty
=
function
()
{
...
...
@@ -124,6 +142,10 @@ angular.module('activitiModeler').controller('KisBpmFormPropertiesPopupCtrl',
readable
:
true
,
writable
:
true
};
$timeout
(
function
(){
$scope
.
gridOptions
.
selectItem
(
$scope
.
formProperties
.
length
-
1
,
true
);
});
$scope
.
formProperties
.
push
(
newProperty
);
...
...
@@ -187,6 +209,69 @@ angular.module('activitiModeler').controller('KisBpmFormPropertiesPopupCtrl',
}
}
};
$scope
.
addNewEnumValue
=
function
()
{
if
(
$scope
.
selectedProperties
.
length
>
0
)
{
$scope
.
selectedProperties
[
0
].
enumValues
.
push
({
id
:
''
,
name
:
''
});
}
$timeout
(
function
(){
$scope
.
enumGridOptions
.
selectItem
(
$scope
.
selectedProperties
[
0
].
enumValues
.
length
-
1
,
true
);
});
};
// Click handler for remove button
$scope
.
removeEnumValue
=
function
()
{
if
(
$scope
.
selectedProperties
.
length
>
0
&&
$scope
.
selectedEnumValues
.
length
>
0
)
{
var
index
=
$scope
.
selectedProperties
[
0
].
enumValues
.
indexOf
(
$scope
.
selectedEnumValues
[
0
]);
$scope
.
enumGridOptions
.
selectItem
(
index
,
false
);
$scope
.
selectedProperties
[
0
].
enumValues
.
splice
(
index
,
1
);
$scope
.
selectedEnumValues
.
length
=
0
;
if
(
index
<
$scope
.
selectedProperties
[
0
].
enumValues
.
length
)
{
$timeout
(
function
(){
$scope
.
enumGridOptions
.
selectItem
(
index
+
1
,
true
);
});
}
else
if
(
$scope
.
selectedProperties
[
0
].
enumValues
.
length
>
0
)
{
$timeout
(
function
(){
$scope
.
enumGridOptions
.
selectItem
(
index
-
1
,
true
);
});
}
}
};
// Click handler for up button
$scope
.
moveEnumValueUp
=
function
()
{
if
(
$scope
.
selectedProperties
.
length
>
0
&&
$scope
.
selectedEnumValues
.
length
>
0
)
{
var
index
=
$scope
.
selectedProperties
[
0
].
enumValues
.
indexOf
(
$scope
.
selectedEnumValues
[
0
]);
if
(
index
!=
0
)
{
// If it's the first, no moving up of course
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
var
temp
=
$scope
.
selectedProperties
[
0
].
enumValues
[
index
];
$scope
.
selectedProperties
[
0
].
enumValues
.
splice
(
index
,
1
);
$timeout
(
function
(){
$scope
.
selectedProperties
[
0
].
enumValues
.
splice
(
index
+
-
1
,
0
,
temp
);
});
}
}
};
// Click handler for down button
$scope
.
moveEnumValueDown
=
function
()
{
if
(
$scope
.
selectedProperties
.
length
>
0
&&
$scope
.
selectedEnumValues
.
length
>
0
)
{
var
index
=
$scope
.
selectedProperties
[
0
].
enumValues
.
indexOf
(
$scope
.
selectedEnumValues
[
0
]);
if
(
index
!=
$scope
.
selectedProperties
[
0
].
enumValues
.
length
-
1
)
{
// If it's the last element, no moving down of course
// Reason for funny way of swapping, see https://github.com/angular-ui/ng-grid/issues/272
var
temp
=
$scope
.
selectedProperties
[
0
].
enumValues
[
index
];
$scope
.
selectedProperties
[
0
].
enumValues
.
splice
(
index
,
1
);
$timeout
(
function
(){
$scope
.
selectedProperties
[
0
].
enumValues
.
splice
(
index
+
1
,
0
,
temp
);
});
}
}
};
// Click handler for save button
$scope
.
save
=
function
()
{
...
...
modules/activiti-ui/activiti-app/src/main/webapp/editor/editor-app/configuration/properties/form-properties-popup.html
浏览文件 @
e813005b
...
...
@@ -48,13 +48,37 @@
<label
for=
"datePatternField"
>
{{'PROPERTY.FORMPROPERTIES.DATEPATTERN' | translate}}
</label>
<input
id=
"datePatternField"
class=
"form-control"
type=
"text"
ng-model=
"selectedProperty.datePattern"
placeholder=
"{{'PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER' | translate }}"
/>
</div>
<div
class=
"form-group"
ng-show=
"selectedProperty.enumValues"
>
<label
for=
"valueField"
>
{{'PROPERTY.FORMPROPERTIES.VALUES' | translate}}
</label>
<div
ng-repeat=
"enum in selectedProperty.enumValues"
>
<input
id=
"valueField"
class=
"form-control"
type=
"text"
ng-model=
"enum.value"
/>
<i
class=
"glyphicon glyphicon-minus clickable-property"
ng-click=
"removeEnumValue($index)"
></i>
<i
ng-if=
"$index == (selectedProperty.enumValues.length - 1)"
class=
"glyphicon glyphicon-plus clickable-property"
ng-click=
"addEnumValue($index)"
></i>
<div
ng-if=
"selectedProperties[0].type == 'enum'"
style=
"padding-bottom:10px"
>
<div
class=
"row row-no-gutter"
>
<div
class=
"col-xs-6"
>
<div
ng-if=
"translationsRetrieved"
class=
"kis-listener-grid"
ng-grid=
"enumGridOptions"
></div>
<div
class=
"pull-right"
>
<div
class=
"btn-group"
>
<a
class=
"btn btn-icon btn-lg"
rel=
"tooltip"
data-title=
"{{ACTION.MOVE.UP | translate}}"
data-placement=
"bottom"
data-original-title=
""
title=
""
ng-click=
"moveEnumValueUp()"
><i
class=
"glyphicon glyphicon-arrow-up"
></i></a>
<a
class=
"btn btn-icon btn-lg"
rel=
"tooltip"
data-title=
"{{ACTION.MOVE.DOWN | translate}}"
data-placement=
"bottom"
data-original-title=
""
title=
""
ng-click=
"moveEnumValueDown()"
><i
class=
"glyphicon glyphicon-arrow-down"
></i></a>
</div>
<div
class=
"btn-group"
>
<a
class=
"btn btn-icon btn-lg"
rel=
"tooltip"
data-title=
"{{ACTION.ADD | translate}}"
data-placement=
"bottom"
data-original-title=
""
title=
""
ng-click=
"addNewEnumValue()"
><i
class=
"glyphicon glyphicon-plus"
></i></a>
<a
class=
"btn btn-icon btn-lg"
rel=
"tooltip"
data-title=
"{{ACTION.REMOVE | translate}}"
data-placement=
"bottom"
data-original-title=
""
title=
""
ng-click=
"removeEnumValue()"
><i
class=
"glyphicon glyphicon-minus"
></i></a>
</div>
</div>
</div>
<div
class=
"col-xs-6"
>
<div
ng-show=
"selectedEnumValues.length > 0"
>
<div
class=
"form-group"
>
<label
for=
"classField"
>
{{'PROPERTY.FORMPROPERTIES.VALUES.ID' | translate}}
</label>
<input
type=
"text"
id=
"classField"
class=
"form-control"
ng-model=
"selectedEnumValues[0].id"
placeholder=
"{{'PROPERTY.FORMPROPERTIES.VALUES.ID.PLACEHOLDER' | translate}}"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"classField"
>
{{'PROPERTY.FORMPROPERTIES.VALUES.NAME' | translate}}
</label>
<input
type=
"text"
id=
"classField"
class=
"form-control"
ng-model=
"selectedEnumValues[0].name"
placeholder=
"{{'PROPERTY.FORMPROPERTIES.VALUES.NAME.PLACEHOLDER' | translate}}"
/>
</div>
</div>
<div
ng-show=
"selectedEnumValues.length == 0"
class=
"muted no-property-selected"
translate
>
PROPERTY.FORMPROPERTIES.ENUMVALUES.EMPTY
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"expressionField"
>
{{'PROPERTY.FORMPROPERTIES.EXPRESSION' | translate}}
</label>
...
...
modules/activiti-ui/activiti-app/src/main/webapp/editor/i18n/en.json
浏览文件 @
e813005b
...
...
@@ -1376,7 +1376,7 @@
"PROPERTY.FIELDS.UNSELECTED"
:
"No Field selected"
,
"PROPERTY.FORMPROPERTIES.VALUE"
:
"{{length}} form properties"
,
"PROPERTY.FORMPROPERTIES.EMPTY"
:
"No form properties
configur
ed"
,
"PROPERTY.FORMPROPERTIES.EMPTY"
:
"No form properties
select
ed"
,
"PROPERTY.FORMPROPERTIES.ID"
:
"Id"
,
"PROPERTY.FORMPROPERTIES.ID.PLACEHOLDER"
:
"Enter an id"
,
"PROPERTY.FORMPROPERTIES.NAME"
:
"Name"
,
...
...
@@ -1385,6 +1385,11 @@
"PROPERTY.FORMPROPERTIES.DATEPATTERN"
:
"Date pattern"
,
"PROPERTY.FORMPROPERTIES.DATEPATTERN.PLACEHOLDER"
:
"Enter date pattern"
,
"PROPERTY.FORMPROPERTIES.VALUES"
:
"Values"
,
"PROPERTY.FORMPROPERTIES.ENUMVALUES.EMPTY"
:
"No enum value selected"
,
"PROPERTY.FORMPROPERTIES.VALUES.ID"
:
"Id"
,
"PROPERTY.FORMPROPERTIES.VALUES.NAME"
:
"Name"
,
"PROPERTY.FORMPROPERTIES.VALUES.ID.PLACEHOLDER"
:
"Enter id of a value"
,
"PROPERTY.FORMPROPERTIES.VALUES.NAME.PLACEHOLDER"
:
"Enter name of a value"
,
"PROPERTY.FORMPROPERTIES.EXPRESSION"
:
"Expression"
,
"PROPERTY.FORMPROPERTIES.EXPRESSION.PLACEHOLDER"
:
"Enter an expression"
,
"PROPERTY.FORMPROPERTIES.VARIABLE"
:
"Variable"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录