Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
874c9bed
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,发现更多精彩内容 >>
提交
874c9bed
编写于
9月 10, 2014
作者:
T
Tijs Rademakers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Made it working for execution listeners as well
上级
ceb28292
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
25 deletion
+39
-25
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
.../java/org/activiti/editor/constants/StencilConstants.java
+4
-5
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/BaseBpmnJsonConverter.java
...editor/language/json/converter/BaseBpmnJsonConverter.java
+35
-20
未找到文件。
modules/activiti-json-converter/src/main/java/org/activiti/editor/constants/StencilConstants.java
浏览文件 @
874c9bed
...
...
@@ -120,11 +120,10 @@ public interface StencilConstants {
final
String
PROPERTY_EXECUTION_LISTENER_CLASS
=
"execution_listener_class"
;
final
String
PROPERTY_EXECUTION_LISTENER_EXPRESSION
=
"execution_listener_expression"
;
final
String
PROPERTY_EXECUTION_LISTENER_DELEGATEEXPRESSION
=
"execution_listener_delegate_expression"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELDS
=
"execution_listener_fields"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_NAME
=
"execution_listener_field_name"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_VALUE
=
"execution_listener_field_value"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_EXPRESSION
=
"execution_listener_field_expression"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELDS
=
"execution_listener_fields"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_NAME
=
"execution_listener_field_name"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_VALUE
=
"execution_listener_field_value"
;
final
String
PROPERTY_EXECUTION_LISTENER_FIELD_EXPRESSION
=
"execution_listener_field_expression"
;
final
String
PROPERTY_EVENT_LISTENERS
=
"eventlisteners"
;
final
String
PROPERTY_EVENT_LISTENER_EVENTS
=
"event_listener_events"
;
...
...
modules/activiti-json-converter/src/main/java/org/activiti/editor/language/json/converter/BaseBpmnJsonConverter.java
浏览文件 @
874c9bed
...
...
@@ -314,10 +314,8 @@ public abstract class BaseBpmnJsonConverter implements EditorJsonConstants, Sten
if
(
ImplementationType
.
IMPLEMENTATION_TYPE_CLASS
.
equals
(
listener
.
getImplementationType
()))
{
propertyItemNode
.
put
(
listenerClass
,
listener
.
getImplementation
());
// If this is a Task Listener then add field extensions
if
(!
isExecutionListener
)
{
addTaskFieldExtensions
(
listener
.
getFieldExtensions
(),
propertyItemNode
);
}
addFieldExtensions
(
listener
.
getFieldExtensions
(),
propertyItemNode
,
isExecutionListener
);
}
else
if
(
ImplementationType
.
IMPLEMENTATION_TYPE_EXPRESSION
.
equals
(
listener
.
getImplementationType
()))
{
propertyItemNode
.
put
(
listenerExpression
,
listener
.
getImplementation
());
}
else
if
(
ImplementationType
.
IMPLEMENTATION_TYPE_DELEGATEEXPRESSION
.
equals
(
listener
.
getImplementationType
()))
{
...
...
@@ -332,24 +330,41 @@ public abstract class BaseBpmnJsonConverter implements EditorJsonConstants, Sten
propertiesNode
.
put
(
propertyName
,
listenersNode
);
}
protected
void
addTaskFieldExtensions
(
List
<
FieldExtension
>
extensions
,
ObjectNode
propertiesNode
)
{
ObjectNode
fieldExtensionsNode
=
objectMapper
.
createObjectNode
();
ArrayNode
itemsNode
=
objectMapper
.
createArrayNode
();
for
(
FieldExtension
extension
:
extensions
)
{
ObjectNode
propertyItemNode
=
objectMapper
.
createObjectNode
();
propertyItemNode
.
put
(
PROPERTY_TASK_LISTENER_FIELD_NAME
,
extension
.
getFieldName
());
if
(
StringUtils
.
isNotEmpty
(
extension
.
getStringValue
()))
{
propertyItemNode
.
put
(
PROPERTY_TASK_LISTENER_FIELD_VALUE
,
extension
.
getStringValue
());
}
if
(
StringUtils
.
isNotEmpty
(
extension
.
getExpression
()))
{
propertyItemNode
.
put
(
PROPERTY_TASK_LISTENER_FIELD_EXPRESSION
,
extension
.
getExpression
());
}
itemsNode
.
add
(
propertyItemNode
);
protected
void
addFieldExtensions
(
List
<
FieldExtension
>
extensions
,
ObjectNode
propertiesNode
,
boolean
isExecutionListener
)
{
String
fieldNameProperty
=
null
;
String
fieldValueProperty
=
null
;
String
fieldExpressionProperty
=
null
;
String
fieldProperty
=
null
;
if
(
isExecutionListener
)
{
fieldNameProperty
=
PROPERTY_EXECUTION_LISTENER_FIELD_NAME
;
fieldValueProperty
=
PROPERTY_EXECUTION_LISTENER_FIELD_VALUE
;
fieldExpressionProperty
=
PROPERTY_EXECUTION_LISTENER_FIELD_EXPRESSION
;
fieldProperty
=
PROPERTY_EXECUTION_LISTENER_FIELDS
;
}
else
{
fieldNameProperty
=
PROPERTY_TASK_LISTENER_FIELD_NAME
;
fieldValueProperty
=
PROPERTY_TASK_LISTENER_FIELD_VALUE
;
fieldExpressionProperty
=
PROPERTY_TASK_LISTENER_FIELD_EXPRESSION
;
fieldProperty
=
PROPERTY_TASK_LISTENER_FIELDS
;
}
ObjectNode
fieldExtensionsNode
=
objectMapper
.
createObjectNode
();
ArrayNode
itemsNode
=
objectMapper
.
createArrayNode
();
for
(
FieldExtension
extension
:
extensions
)
{
ObjectNode
propertyItemNode
=
objectMapper
.
createObjectNode
();
propertyItemNode
.
put
(
fieldNameProperty
,
extension
.
getFieldName
());
if
(
StringUtils
.
isNotEmpty
(
extension
.
getStringValue
()))
{
propertyItemNode
.
put
(
fieldValueProperty
,
extension
.
getStringValue
());
}
if
(
StringUtils
.
isNotEmpty
(
extension
.
getExpression
()))
{
propertyItemNode
.
put
(
fieldExpressionProperty
,
extension
.
getExpression
());
}
itemsNode
.
add
(
propertyItemNode
);
}
fieldExtensionsNode
.
put
(
"totalCount"
,
itemsNode
.
size
());
fieldExtensionsNode
.
put
(
EDITOR_PROPERTIES_GENERAL_ITEMS
,
itemsNode
);
propertiesNode
.
put
(
PROPERTY_TASK_LISTENER_FIELDS
,
fieldExtensionsNode
.
toString
());
fieldExtensionsNode
.
put
(
"totalCount"
,
itemsNode
.
size
());
fieldExtensionsNode
.
put
(
EDITOR_PROPERTIES_GENERAL_ITEMS
,
itemsNode
);
propertiesNode
.
put
(
fieldProperty
,
fieldExtensionsNode
.
toString
());
}
protected
void
addFieldExtensions
(
List
<
FieldExtension
>
extensions
,
ObjectNode
propertiesNode
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录