Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z_stack
Activiti
提交
1f83c9f4
A
Activiti
项目概览
z_stack
/
Activiti
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Activiti
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1f83c9f4
编写于
1月 22, 2019
作者:
S
salaboy
提交者:
GitHub
1月 22, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2374 from Activiti/daisuke-2184-json-el-resolver
Handling expressions for json variables
上级
d3259d28
8cbdec9e
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
767 addition
and
366 deletion
+767
-366
activiti-engine/src/main/java/org/activiti/engine/impl/el/JsonNodeELResolver.java
.../java/org/activiti/engine/impl/el/JsonNodeELResolver.java
+333
-293
activiti-engine/src/main/java/org/activiti/engine/impl/el/VariableScopeElResolver.java
.../org/activiti/engine/impl/el/VariableScopeElResolver.java
+100
-73
activiti-engine/src/test/java/org/activiti/engine/test/json/SerializePOJOJsonTest.java
.../org/activiti/engine/test/json/SerializePOJOJsonTest.java
+108
-0
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testCollectionInJsonVarInExpression.bpmn20.xml
...JOJsonTest.testCollectionInJsonVarInExpression.bpmn20.xml
+42
-0
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testCollectionJsonVarInExpression.bpmn20.xml
...POJOJsonTest.testCollectionJsonVarInExpression.bpmn20.xml
+42
-0
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testJsonVarInExpression.bpmn20.xml
.../SerializePOJOJsonTest.testJsonVarInExpression.bpmn20.xml
+40
-0
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testPOJOCollectionInJsonVarInExpression.bpmn20.xml
...onTest.testPOJOCollectionInJsonVarInExpression.bpmn20.xml
+42
-0
activiti-engine/src/test/resources/org/activiti/standalone/cfg/variable/custom-serialize-variables-activiti.cfg.xml
.../cfg/variable/custom-serialize-variables-activiti.cfg.xml
+60
-0
未找到文件。
activiti-engine/src/main/java/org/activiti/engine/impl/el/JsonNodeELResolver.java
浏览文件 @
1f83c9f4
此差异已折叠。
点击以展开。
activiti-engine/src/main/java/org/activiti/engine/impl/el/VariableScopeElResolver.java
浏览文件 @
1f83c9f4
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
...
@@ -14,90 +14,117 @@ package org.activiti.engine.impl.el;
import
java.beans.FeatureDescriptor
;
import
java.util.Iterator
;
import
java.util.List
;
import
javax.el.ELContext
;
import
javax.el.ELResolver
;
import
org.activiti.engine.delegate.VariableScope
;
import
org.activiti.engine.impl.context.Context
;
import
org.activiti.engine.impl.identity.Authentication
;
import
org.activiti.engine.impl.persistence.entity.ExecutionEntity
;
import
org.activiti.engine.impl.persistence.entity.TaskEntity
;
import
org.activiti.engine.impl.persistence.entity.VariableInstance
;
import
com.fasterxml.jackson.databind.JsonNode
;
/**
* Implementation of an {@link ELResolver} that resolves expressions with the process variables of a given {@link VariableScope} as context. <br>
* Also exposes the currently logged in username to be used in expressions (if any)
* Implementation of an {@link ELResolver} that resolves expressions with the
* process variables of a given {@link VariableScope} as context. <br>
* Also exposes the currently logged in username to be used in expressions (if
* any)
*
*
*
*/
public
class
VariableScopeElResolver
extends
ELResolver
{
public
static
final
String
EXECUTION_KEY
=
"execution"
;
public
static
final
String
TASK_KEY
=
"task"
;
public
static
final
String
LOGGED_IN_USER_KEY
=
"authenticatedUserId"
;
protected
VariableScope
variableScope
;
public
VariableScopeElResolver
(
VariableScope
variableScope
)
{
this
.
variableScope
=
variableScope
;
}
public
Object
getValue
(
ELContext
context
,
Object
base
,
Object
property
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
// according to javadoc, can only be a String
if
((
EXECUTION_KEY
.
equals
(
property
)
&&
variableScope
instanceof
ExecutionEntity
)
||
(
TASK_KEY
.
equals
(
property
)
&&
variableScope
instanceof
TaskEntity
))
{
context
.
setPropertyResolved
(
true
);
return
variableScope
;
}
else
if
(
EXECUTION_KEY
.
equals
(
property
)
&&
variableScope
instanceof
TaskEntity
)
{
context
.
setPropertyResolved
(
true
);
return
((
TaskEntity
)
variableScope
).
getExecution
();
}
else
if
(
LOGGED_IN_USER_KEY
.
equals
(
property
))
{
context
.
setPropertyResolved
(
true
);
return
Authentication
.
getAuthenticatedUserId
();
}
else
{
if
(
variableScope
.
hasVariable
(
variable
))
{
context
.
setPropertyResolved
(
true
);
// if not set, the next elResolver in the CompositeElResolver will be called
return
variableScope
.
getVariable
(
variable
);
}
}
}
// property resolution (eg. bean.value) will be done by the
// BeanElResolver (part of the CompositeElResolver)
// It will use the bean resolved in this resolver as base.
return
null
;
}
public
boolean
isReadOnly
(
ELContext
context
,
Object
base
,
Object
property
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
return
!
variableScope
.
hasVariable
(
variable
);
}
return
true
;
}
public
void
setValue
(
ELContext
context
,
Object
base
,
Object
property
,
Object
value
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
if
(
variableScope
.
hasVariable
(
variable
))
{
variableScope
.
setVariable
(
variable
,
value
);
}
}
}
public
Class
<?>
getCommonPropertyType
(
ELContext
arg0
,
Object
arg1
)
{
return
Object
.
class
;
}
public
Iterator
<
FeatureDescriptor
>
getFeatureDescriptors
(
ELContext
arg0
,
Object
arg1
)
{
return
null
;
}
public
Class
<?>
getType
(
ELContext
arg0
,
Object
arg1
,
Object
arg2
)
{
return
Object
.
class
;
}
public
static
final
String
EXECUTION_KEY
=
"execution"
;
public
static
final
String
TASK_KEY
=
"task"
;
public
static
final
String
LOGGED_IN_USER_KEY
=
"authenticatedUserId"
;
protected
VariableScope
variableScope
;
public
VariableScopeElResolver
(
VariableScope
variableScope
)
{
this
.
variableScope
=
variableScope
;
}
@Override
public
Object
getValue
(
ELContext
context
,
Object
base
,
Object
property
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
// according to javadoc, can
// only be a String
if
((
EXECUTION_KEY
.
equals
(
property
)
&&
variableScope
instanceof
ExecutionEntity
)
||
(
TASK_KEY
.
equals
(
property
)
&&
variableScope
instanceof
TaskEntity
))
{
context
.
setPropertyResolved
(
true
);
return
variableScope
;
}
else
if
(
EXECUTION_KEY
.
equals
(
property
)
&&
variableScope
instanceof
TaskEntity
)
{
context
.
setPropertyResolved
(
true
);
return
((
TaskEntity
)
variableScope
).
getExecution
();
}
else
if
(
LOGGED_IN_USER_KEY
.
equals
(
property
))
{
context
.
setPropertyResolved
(
true
);
return
Authentication
.
getAuthenticatedUserId
();
}
else
{
if
(
variableScope
.
hasVariable
(
variable
))
{
context
.
setPropertyResolved
(
true
);
// if not set, the next
// elResolver in the
// CompositeElResolver
// will be called
VariableInstance
variableInstance
=
variableScope
.
getVariableInstance
(
variable
);
Object
value
=
variableInstance
.
getValue
();
if
((
"json"
.
equals
(
variableInstance
.
getTypeName
())
||
"longJson"
.
equals
(
variableInstance
.
getTypeName
()))
&&
(
value
instanceof
JsonNode
)
&&
((
JsonNode
)
value
).
isArray
())
{
return
Context
.
getProcessEngineConfiguration
().
getObjectMapper
().
convertValue
(
value
,
List
.
class
);
}
else
{
return
value
;
}
}
}
}
// property resolution (eg. bean.value) will be done by the
// BeanElResolver (part of the CompositeElResolver)
// It will use the bean resolved in this resolver as base.
return
null
;
}
@Override
public
boolean
isReadOnly
(
ELContext
context
,
Object
base
,
Object
property
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
return
!
variableScope
.
hasVariable
(
variable
);
}
return
true
;
}
@Override
public
void
setValue
(
ELContext
context
,
Object
base
,
Object
property
,
Object
value
)
{
if
(
base
==
null
)
{
String
variable
=
(
String
)
property
;
if
(
variableScope
.
hasVariable
(
variable
))
{
variableScope
.
setVariable
(
variable
,
value
);
}
}
}
@Override
public
Class
<?>
getCommonPropertyType
(
ELContext
arg0
,
Object
arg1
)
{
return
Object
.
class
;
}
@Override
public
Iterator
<
FeatureDescriptor
>
getFeatureDescriptors
(
ELContext
arg0
,
Object
arg1
)
{
return
null
;
}
@Override
public
Class
<?>
getType
(
ELContext
arg0
,
Object
arg1
,
Object
arg2
)
{
return
Object
.
class
;
}
}
activiti-engine/src/test/java/org/activiti/engine/test/json/SerializePOJOJsonTest.java
0 → 100644
浏览文件 @
1f83c9f4
package
org.activiti.engine.test.json
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Consumer
;
import
org.activiti.engine.history.HistoricTaskInstance
;
import
org.activiti.engine.impl.test.ResourceActivitiTestCase
;
import
org.activiti.engine.runtime.ProcessInstance
;
import
org.activiti.engine.task.IdentityLink
;
import
org.activiti.engine.task.Task
;
import
org.activiti.engine.test.Deployment
;
import
org.activiti.examples.variables.SomeSerializable
;
public
class
SerializePOJOJsonTest
extends
ResourceActivitiTestCase
{
public
SerializePOJOJsonTest
()
{
super
(
"org/activiti/standalone/cfg/variable/custom-serialize-variables-activiti.cfg.xml"
);
}
@Deployment
public
void
testJsonVarInExpression
()
throws
Exception
{
Map
<
String
,
Object
>
vars
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"assignee"
,
"salaboy"
);
map
.
put
(
"category"
,
"test"
);
Map
<
String
,
Object
>
mapInMap
=
new
HashMap
<
String
,
Object
>();
mapInMap
.
put
(
"user"
,
"salaboy"
);
map
.
put
(
"mapInMap"
,
mapInMap
);
vars
.
put
(
"userMap"
,
map
);
List
<
String
>
list
=
Arrays
.
asList
(
"salaboy"
,
"salaboy"
,
"salaboy"
);
vars
.
put
(
"userCollection"
,
list
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testJsonVarInExpression"
,
vars
);
String
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
complete
(
taskId
);
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
getIdentityLinksForTask
(
taskId
).
stream
().
forEach
(
new
Consumer
<
IdentityLink
>()
{
@Override
public
void
accept
(
IdentityLink
i
)
{
if
(
"candidate"
.
equals
(
i
.
getType
())
)
{
assertEquals
(
"salaboy"
,
i
.
getUserId
());
}
}
});
taskService
.
complete
(
taskId
);
HistoricTaskInstance
task
=
historyService
.
createHistoricTaskInstanceQuery
().
taskId
(
taskId
).
singleResult
();
assertEquals
(
"salaboy"
,
task
.
getAssignee
());
assertEquals
(
"test"
,
task
.
getCategory
());
}
@Deployment
public
void
testCollectionJsonVarInExpression
()
throws
Exception
{
Map
<
String
,
Object
>
vars
=
new
HashMap
<
String
,
Object
>();
List
<
String
>
list
=
Arrays
.
asList
(
"salaboy"
,
"salaboy"
,
"salaboy"
);
vars
.
put
(
"userCollection"
,
list
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testCollectionJsonVarInExpression"
,
vars
);
String
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
complete
(
taskId
);
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
list
();
assertEquals
(
3
,
tasks
.
size
());
tasks
.
forEach
(
task
->
taskService
.
complete
(
task
.
getId
()));
}
@Deployment
public
void
testCollectionInJsonVarInExpression
()
throws
Exception
{
Map
<
String
,
Object
>
vars
=
new
HashMap
<
String
,
Object
>();
List
<
String
>
list
=
Arrays
.
asList
(
"salaboy"
,
"salaboy"
,
"salaboy"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"userCollection"
,
list
);
vars
.
put
(
"userMap"
,
map
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testCollectionInJsonVarInExpression"
,
vars
);
String
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
complete
(
taskId
);
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
list
().
forEach
(
task
->
taskService
.
complete
(
task
.
getId
()));
vars
=
new
HashMap
<
String
,
Object
>();
List
<
SomeSerializable
>
beanList
=
Arrays
.
asList
(
new
SomeSerializable
(
"salaboy"
),
new
SomeSerializable
(
"salaboy"
),
new
SomeSerializable
(
"salaboy"
));
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"userCollection"
,
beanList
);
vars
.
put
(
"userMap"
,
map
);
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testCollectionInJsonVarInExpression"
,
vars
);
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
complete
(
taskId
);
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
list
();
assertEquals
(
3
,
tasks
.
size
());
tasks
.
forEach
(
task
->
taskService
.
complete
(
task
.
getId
()));
}
@Deployment
public
void
testPOJOCollectionInJsonVarInExpression
()
throws
Exception
{
Map
<
String
,
Object
>
vars
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
vars
=
new
HashMap
<
String
,
Object
>();
List
<
SomeSerializable
>
beanList
=
Arrays
.
asList
(
new
SomeSerializable
(
"salaboy"
),
new
SomeSerializable
(
"salaboy"
),
new
SomeSerializable
(
"salaboy"
));
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"userCollection"
,
beanList
);
vars
.
put
(
"userMap"
,
map
);
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"testPOJOCollectionInJsonVarInExpression"
,
vars
);
String
taskId
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
().
getId
();
taskService
.
complete
(
taskId
);
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
list
();
assertEquals
(
3
,
tasks
.
size
());
tasks
.
forEach
(
task
->
taskService
.
complete
(
task
.
getId
()));
}
}
\ No newline at end of file
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testCollectionInJsonVarInExpression.bpmn20.xml
0 → 100644
浏览文件 @
1f83c9f4
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"Examples"
>
<process
id=
"testCollectionInJsonVarInExpression"
name=
"Test Collection In Json Var In Expression"
isExecutable=
"true"
>
<startEvent
id=
"theStart"
></startEvent>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"userTask"
></sequenceFlow>
<userTask
id=
"userTask"
></userTask>
<endEvent
id=
"theEndSuccess"
></endEvent>
<userTask
id=
"usertask1"
name=
"User Task"
>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"${userMap.userCollection}"
></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow
id=
"flow2"
sourceRef=
"userTask"
targetRef=
"usertask1"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
sourceRef=
"usertask1"
targetRef=
"theEndSuccess"
></sequenceFlow>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_testCollectionInJsonVarInExpression"
>
<bpmndi:BPMNPlane
bpmnElement=
"testCollectionInJsonVarInExpression"
id=
"BPMNPlane_testCollectionInJsonVarInExpression"
>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"70.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"userTask"
id=
"BPMNShape_userTask"
>
<omgdc:Bounds
height=
"60.0"
width=
"100.0"
x=
"170.0"
y=
"83.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEndSuccess"
id=
"BPMNShape_theEndSuccess"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"490.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"usertask1"
id=
"BPMNShape_usertask1"
>
<omgdc:Bounds
height=
"55.0"
width=
"105.0"
x=
"310.0"
y=
"85.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"105.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"170.0"
y=
"113.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"270.0"
y=
"113.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"310.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"415.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"490.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testCollectionJsonVarInExpression.bpmn20.xml
0 → 100644
浏览文件 @
1f83c9f4
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"Examples"
>
<process
id=
"testCollectionJsonVarInExpression"
name=
"Test Collection Json Var In Expression"
isExecutable=
"true"
>
<startEvent
id=
"theStart"
></startEvent>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"userTask"
></sequenceFlow>
<userTask
id=
"userTask"
></userTask>
<endEvent
id=
"theEndSuccess"
></endEvent>
<userTask
id=
"usertask1"
name=
"User Task"
>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"${userCollection}"
></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow
id=
"flow2"
sourceRef=
"userTask"
targetRef=
"usertask1"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
sourceRef=
"usertask1"
targetRef=
"theEndSuccess"
></sequenceFlow>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_testCollectionJsonVarInExpression"
>
<bpmndi:BPMNPlane
bpmnElement=
"testCollectionJsonVarInExpression"
id=
"BPMNPlane_testCollectionJsonVarInExpression"
>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"70.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"userTask"
id=
"BPMNShape_userTask"
>
<omgdc:Bounds
height=
"60.0"
width=
"100.0"
x=
"170.0"
y=
"83.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEndSuccess"
id=
"BPMNShape_theEndSuccess"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"490.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"usertask1"
id=
"BPMNShape_usertask1"
>
<omgdc:Bounds
height=
"55.0"
width=
"105.0"
x=
"310.0"
y=
"85.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"105.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"170.0"
y=
"113.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"270.0"
y=
"113.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"310.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"415.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"490.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testJsonVarInExpression.bpmn20.xml
0 → 100644
浏览文件 @
1f83c9f4
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"Examples"
>
<process
id=
"testJsonVarInExpression"
name=
"Test Json Var In Expression"
isExecutable=
"true"
>
<startEvent
id=
"theStart"
></startEvent>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"userTask"
></sequenceFlow>
<userTask
id=
"userTask"
></userTask>
<endEvent
id=
"theEndSuccess"
></endEvent>
<userTask
id=
"usertask1"
name=
"User Task"
activiti:assignee=
"${userMap.assignee}"
activiti:candidateUsers=
"${userMap.mapInMap.user}"
activiti:category=
"${userMap.category}"
></userTask>
<sequenceFlow
id=
"flow2"
sourceRef=
"userTask"
targetRef=
"usertask1"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
sourceRef=
"usertask1"
targetRef=
"theEndSuccess"
></sequenceFlow>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_testJsonVarInExpression"
>
<bpmndi:BPMNPlane
bpmnElement=
"testJsonVarInExpression"
id=
"BPMNPlane_testJsonVarInExpression"
>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"70.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"userTask"
id=
"BPMNShape_userTask"
>
<omgdc:Bounds
height=
"60.0"
width=
"100.0"
x=
"170.0"
y=
"83.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEndSuccess"
id=
"BPMNShape_theEndSuccess"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"490.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"usertask1"
id=
"BPMNShape_usertask1"
>
<omgdc:Bounds
height=
"55.0"
width=
"105.0"
x=
"310.0"
y=
"85.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"105.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"170.0"
y=
"113.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"270.0"
y=
"113.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"310.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"415.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"490.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
activiti-engine/src/test/resources/org/activiti/engine/test/json/SerializePOJOJsonTest.testPOJOCollectionInJsonVarInExpression.bpmn20.xml
0 → 100644
浏览文件 @
1f83c9f4
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"Examples"
>
<process
id=
"testPOJOCollectionInJsonVarInExpression"
name=
"Test POJO Collection In Json Var In Expression"
isExecutable=
"true"
>
<startEvent
id=
"theStart"
></startEvent>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"userTask"
></sequenceFlow>
<userTask
id=
"userTask"
></userTask>
<endEvent
id=
"theEndSuccess"
></endEvent>
<userTask
id=
"usertask1"
name=
"User Task"
activiti:assignee=
"${userMap.userCollection.get(0).value}"
>
<multiInstanceLoopCharacteristics
isSequential=
"false"
activiti:collection=
"${userMap.userCollection}"
></multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow
id=
"flow2"
sourceRef=
"userTask"
targetRef=
"usertask1"
></sequenceFlow>
<sequenceFlow
id=
"flow3"
sourceRef=
"usertask1"
targetRef=
"theEndSuccess"
></sequenceFlow>
</process>
<bpmndi:BPMNDiagram
id=
"BPMNDiagram_testPOJOCollectionInJsonVarInExpression"
>
<bpmndi:BPMNPlane
bpmnElement=
"testPOJOCollectionInJsonVarInExpression"
id=
"BPMNPlane_testPOJOCollectionInJsonVarInExpression"
>
<bpmndi:BPMNShape
bpmnElement=
"theStart"
id=
"BPMNShape_theStart"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"70.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"userTask"
id=
"BPMNShape_userTask"
>
<omgdc:Bounds
height=
"60.0"
width=
"100.0"
x=
"170.0"
y=
"83.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"theEndSuccess"
id=
"BPMNShape_theEndSuccess"
>
<omgdc:Bounds
height=
"35.0"
width=
"35.0"
x=
"490.0"
y=
"95.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"usertask1"
id=
"BPMNShape_usertask1"
>
<omgdc:Bounds
height=
"55.0"
width=
"105.0"
x=
"310.0"
y=
"85.0"
></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge
bpmnElement=
"flow1"
id=
"BPMNEdge_flow1"
>
<omgdi:waypoint
x=
"105.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"170.0"
y=
"113.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow2"
id=
"BPMNEdge_flow2"
>
<omgdi:waypoint
x=
"270.0"
y=
"113.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"310.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge
bpmnElement=
"flow3"
id=
"BPMNEdge_flow3"
>
<omgdi:waypoint
x=
"415.0"
y=
"112.0"
></omgdi:waypoint>
<omgdi:waypoint
x=
"490.0"
y=
"112.0"
></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
activiti-engine/src/test/resources/org/activiti/standalone/cfg/variable/custom-serialize-variables-activiti.cfg.xml
0 → 100644
浏览文件 @
1f83c9f4
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<bean
id=
"processEngineConfiguration"
class=
"org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"
>
<property
name=
"jdbcUrl"
value=
"jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000;MVCC=TRUE"
/>
<property
name=
"jdbcDriver"
value=
"org.h2.Driver"
/>
<property
name=
"jdbcUsername"
value=
"sa"
/>
<property
name=
"jdbcPassword"
value=
""
/>
<!-- Database configurations -->
<property
name=
"databaseSchemaUpdate"
value=
"drop-create"
/>
<!-- Test logger -->
<!-- <property name="configurators">
<list>
<bean class="org.activiti.engine.test.impl.logger.ProcessExecutionLoggerConfigurator" />
</list>
</property> -->
<!-- job executor configurations -->
<property
name=
"asyncExecutor"
ref=
"asyncExecutor"
/>
<property
name=
"asyncExecutorActivate"
value=
"true"
/>
<property
name=
"asyncFailedJobWaitTime"
value=
"1"
/>
<!-- mail server configurations -->
<property
name=
"mailServerPort"
value=
"5025"
/>
<property
name=
"mailServers"
>
<map>
<entry
key=
"myEmailTenant"
>
<bean
class=
"org.activiti.engine.cfg.MailServerInfo"
>
<property
name=
"mailServerHost"
value=
"localhost"
/>
<property
name=
"mailServerPort"
value=
"5025"
/>
<property
name=
"mailServerUseSSL"
value=
"false"
/>
<property
name=
"mailServerUseTLS"
value=
"false"
/>
<property
name=
"mailServerDefaultFrom"
value=
"activiti@myTenant.com"
/>
<property
name=
"mailServerUsername"
value=
"activiti@myTenant.com"
/>
<property
name=
"mailServerPassword"
value=
"password"
/>
</bean>
</entry>
</map>
</property>
<property
name=
"history"
value=
"full"
/>
<property
name=
"enableProcessDefinitionInfoCache"
value=
"true"
/>
<property
name=
"serializePOJOsInVariablesToJson"
value=
"true"
/>
</bean>
<bean
id=
"asyncExecutor"
class=
"org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor"
>
<property
name=
"defaultAsyncJobAcquireWaitTimeInMillis"
value=
"1000"
/>
<property
name=
"defaultTimerJobAcquireWaitTimeInMillis"
value=
"1000"
/>
</bean>
</beans>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录