Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z_stack
Activiti
提交
3e65a39c
A
Activiti
项目概览
z_stack
/
Activiti
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
3e65a39c
编写于
7月 13, 2022
作者:
I
Igor Dianov
提交者:
GitHub
7月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(GH-3980): Add support for analytics variable extension property in Activiti engine (#3981)
上级
6973bf40
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
70 addition
and
7 deletion
+70
-7
activiti-api/activiti-api-process-model/src/main/java/org/activiti/api/process/model/VariableDefinition.java
...va/org/activiti/api/process/model/VariableDefinition.java
+2
-0
activiti-core-common/activiti-connector-model/src/main/java/org/activiti/core/common/model/connector/VariableDefinition.java
...iviti/core/common/model/connector/VariableDefinition.java
+10
-0
activiti-core/activiti-api-impl/activiti-api-process-model-impl/src/main/java/org/activiti/api/runtime/model/impl/VariableDefinitionImpl.java
...tiviti/api/runtime/model/impl/VariableDefinitionImpl.java
+15
-2
activiti-core/activiti-spring-process-extensions/src/test/java/org/activiti/spring/process/ProcessExtensionResourceReaderIT.java
...viti/spring/process/ProcessExtensionResourceReaderIT.java
+28
-5
activiti-core/activiti-spring-process-extensions/src/test/resources/processes/initial-vars-extensions.json
...src/test/resources/processes/initial-vars-extensions.json
+15
-0
未找到文件。
activiti-api/activiti-api-process-model/src/main/java/org/activiti/api/process/model/VariableDefinition.java
浏览文件 @
3e65a39c
...
@@ -31,4 +31,6 @@ public interface VariableDefinition {
...
@@ -31,4 +31,6 @@ public interface VariableDefinition {
String
getDisplayName
();
String
getDisplayName
();
boolean
isAnalytics
();
}
}
activiti-core-common/activiti-connector-model/src/main/java/org/activiti/core/common/model/connector/VariableDefinition.java
浏览文件 @
3e65a39c
...
@@ -31,6 +31,8 @@ public class VariableDefinition {
...
@@ -31,6 +31,8 @@ public class VariableDefinition {
private
String
displayName
;
private
String
displayName
;
private
boolean
analytics
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -86,4 +88,12 @@ public class VariableDefinition {
...
@@ -86,4 +88,12 @@ public class VariableDefinition {
public
void
setDisplayName
(
String
displayName
)
{
public
void
setDisplayName
(
String
displayName
)
{
this
.
displayName
=
displayName
;
this
.
displayName
=
displayName
;
}
}
public
boolean
isAnalytics
()
{
return
analytics
;
}
public
void
setAnalytics
(
boolean
analytics
)
{
this
.
analytics
=
analytics
;
}
}
}
activiti-core/activiti-api-impl/activiti-api-process-model-impl/src/main/java/org/activiti/api/runtime/model/impl/VariableDefinitionImpl.java
浏览文件 @
3e65a39c
...
@@ -28,6 +28,7 @@ public class VariableDefinitionImpl implements VariableDefinition {
...
@@ -28,6 +28,7 @@ public class VariableDefinitionImpl implements VariableDefinition {
private
boolean
required
;
private
boolean
required
;
private
Boolean
display
;
private
Boolean
display
;
private
String
displayName
;
private
String
displayName
;
private
boolean
analytics
;
@Override
@Override
public
String
getId
()
{
public
String
getId
()
{
...
@@ -92,6 +93,15 @@ public class VariableDefinitionImpl implements VariableDefinition {
...
@@ -92,6 +93,15 @@ public class VariableDefinitionImpl implements VariableDefinition {
this
.
displayName
=
displayName
;
this
.
displayName
=
displayName
;
}
}
@Override
public
boolean
isAnalytics
()
{
return
analytics
;
}
public
void
setAnalytics
(
boolean
analytics
)
{
this
.
analytics
=
analytics
;
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
o
)
return
true
;
...
@@ -103,12 +113,13 @@ public class VariableDefinitionImpl implements VariableDefinition {
...
@@ -103,12 +113,13 @@ public class VariableDefinitionImpl implements VariableDefinition {
Objects
.
equals
(
name
,
that
.
name
)
&&
Objects
.
equals
(
name
,
that
.
name
)
&&
Objects
.
equals
(
description
,
that
.
description
)
&&
Objects
.
equals
(
description
,
that
.
description
)
&&
Objects
.
equals
(
type
,
that
.
type
)
&&
Objects
.
equals
(
type
,
that
.
type
)
&&
Objects
.
equals
(
displayName
,
that
.
displayName
);
Objects
.
equals
(
displayName
,
that
.
displayName
)
&&
Objects
.
equals
(
analytics
,
that
.
analytics
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
id
,
name
,
description
,
type
,
required
,
display
,
displayName
);
return
Objects
.
hash
(
id
,
name
,
description
,
type
,
required
,
display
,
displayName
,
analytics
);
}
}
@Override
@Override
...
@@ -121,6 +132,8 @@ public class VariableDefinitionImpl implements VariableDefinition {
...
@@ -121,6 +132,8 @@ public class VariableDefinitionImpl implements VariableDefinition {
", required="
+
required
+
", required="
+
required
+
", display="
+
display
+
", display="
+
display
+
", displayName='"
+
displayName
+
'\''
+
", displayName='"
+
displayName
+
'\''
+
", analytics='"
+
analytics
+
'\''
+
'}'
;
'}'
;
}
}
}
}
activiti-core/activiti-spring-process-extensions/src/test/java/org/activiti/spring/process/ProcessExtensionResourceReaderIT.java
浏览文件 @
3e65a39c
...
@@ -15,11 +15,7 @@
...
@@ -15,11 +15,7 @@
*/
*/
package
org.activiti.spring.process
;
package
org.activiti.spring.process
;
import
static
org
.
activiti
.
spring
.
process
.
model
.
TemplateDefinition
.
TemplateType
.
FILE
;
import
org.activiti.core.common.model.connector.VariableDefinition
;
import
static
org
.
activiti
.
spring
.
process
.
model
.
TemplateDefinition
.
TemplateType
.
VARIABLE
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.io.InputStream
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.spring.process.model.ProcessExtensionModel
;
import
org.activiti.spring.process.model.ProcessExtensionModel
;
import
org.activiti.spring.process.model.TaskTemplateDefinition
;
import
org.activiti.spring.process.model.TaskTemplateDefinition
;
...
@@ -30,6 +26,12 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -30,6 +26,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.mock.mockito.MockBean
;
import
org.springframework.boot.test.mock.mockito.MockBean
;
import
java.io.InputStream
;
import
static
org
.
activiti
.
spring
.
process
.
model
.
TemplateDefinition
.
TemplateType
.
FILE
;
import
static
org
.
activiti
.
spring
.
process
.
model
.
TemplateDefinition
.
TemplateType
.
VARIABLE
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
@SpringBootTest
(
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
NONE
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
NONE
,
properties
=
"spring.main.banner-mode=off"
properties
=
"spring.main.banner-mode=off"
...
@@ -168,4 +170,25 @@ public class ProcessExtensionResourceReaderIT {
...
@@ -168,4 +170,25 @@ public class ProcessExtensionResourceReaderIT {
);
);
}
}
}
}
@Test
public
void
shouldReadAnalyticsExtensionFromJsonFile
()
throws
Exception
{
try
(
InputStream
inputStream
=
Thread
.
currentThread
().
getContextClassLoader
()
.
getResourceAsStream
(
"processes/initial-vars-extensions.json"
))
{
ProcessExtensionModel
processExtensionModel
=
reader
.
read
(
inputStream
);
assertThat
(
processExtensionModel
).
isNotNull
();
assertThat
(
processExtensionModel
.
getId
()).
isEqualTo
(
"initialVarsProcess"
);
assertThat
(
processExtensionModel
.
getExtensions
(
"Process_initialVarsProcess"
).
getProperties
())
.
extracting
(
stringVariableDefinitionMap
->
stringVariableDefinitionMap
.
get
(
"379dc1a1-481d-4617-a027-ef39fdadf6667"
))
.
extracting
(
VariableDefinition:
:
getName
,
VariableDefinition:
:
isAnalytics
)
.
containsOnly
(
"trackedId"
,
true
);
assertThat
(
processExtensionModel
.
getExtensions
(
"Process_initialVarsProcess"
).
getProperties
())
.
extracting
(
stringVariableDefinitionMap
->
stringVariableDefinitionMap
.
get
(
"379dc1a1-481d-4617-a027-ef39fdadf6668"
))
.
extracting
(
VariableDefinition:
:
getName
,
VariableDefinition:
:
isAnalytics
)
.
containsOnly
(
"notTrackedId"
,
false
);
}
}
}
}
activiti-core/activiti-spring-process-extensions/src/test/resources/processes/initial-vars-extensions.json
浏览文件 @
3e65a39c
...
@@ -44,6 +44,21 @@
...
@@ -44,6 +44,21 @@
"type"
:
"file"
,
"type"
:
"file"
,
"required"
:
false
,
"required"
:
false
,
"value"
:
{}
"value"
:
{}
},
"379dc1a1-481d-4617-a027-ef39fdadf6667"
:
{
"id"
:
"379dc1a1-481d-4617-a027-ef39fdadf6667"
,
"name"
:
"trackedId"
,
"type"
:
"integer"
,
"required"
:
false
,
"value"
:
0
,
"analytics"
:
true
},
"379dc1a1-481d-4617-a027-ef39fdadf6668"
:
{
"id"
:
"379dc1a1-481d-4617-a027-ef39fdadf6668"
,
"name"
:
"notTrackedId"
,
"type"
:
"integer"
,
"required"
:
false
,
"value"
:
0
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录