Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
2168b365
提交
2168b365
编写于
7月 10, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流事务
上级
8c902863
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
46 行增加
和
39 行删除
+46
-39
ProcessInstanceListener.java
...workflow/extensions/listener/ProcessInstanceListener.java
+29
-38
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+17
-1
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/listener/ProcessInstanceListener.java
浏览文件 @
2168b365
...
...
@@ -24,7 +24,7 @@ import java.util.Map;
@Slf4j
@Component
public
class
ProcessInstanceListener
implements
FlowableEventListener
{
public
class
ProcessInstanceListener
extends
Abstract
FlowableEventListener
{
@Autowired
...
...
@@ -43,29 +43,8 @@ public class ProcessInstanceListener implements FlowableEventListener {
@Override
public
void
onEvent
(
FlowableEvent
evt
)
{
if
(
evt
instanceof
FlowableEntityWithVariablesEventImpl
)
{
FlowableEntityWithVariablesEventImpl
event
=
(
FlowableEntityWithVariablesEventImpl
)
evt
;
if
(
event
.
getType
()
==
FlowableEngineEventType
.
TASK_COMPLETED
)
{
TaskEntity
taskEntity
=
(
TaskEntity
)
event
.
getEntity
();
if
(
taskEntity
.
getTaskDefinitionKey
().
startsWith
(
"tid-"
))
{
Object
data
=
taskEntity
.
getVariable
(
"activedata"
);
Object
link
=
taskEntity
.
getVariable
(
"sequenceFlowName"
);
if
(
data
!=
null
&&(
data
instanceof
Map
)&&
link
!=
null
)
{
Map
activedata
=(
Map
)
data
;
String
srfwfmemo
=
""
;
if
(
activedata
.
get
(
"srfwfmemo"
)!=
null
)
srfwfmemo
=
activedata
.
get
(
"srfwfmemo"
).
toString
();
taskService
.
addComment
(
taskEntity
.
getId
(),
taskEntity
.
getProcessInstanceId
(),
link
.
toString
(),
srfwfmemo
);
}
}
}
}
else
if
(
evt
instanceof
FlowableProcessStartedEventImpl
)
if
(
evt
instanceof
FlowableProcessStartedEventImpl
)
{
FlowableProcessStartedEventImpl
event
=(
FlowableProcessStartedEventImpl
)
evt
;
if
(
event
.
getEntity
()
instanceof
ExecutionEntityImpl
){
...
...
@@ -107,7 +86,7 @@ public class ProcessInstanceListener implements FlowableEventListener {
executionEntity
.
setVariable
(
"wfstatefield"
,
wfstatefield
);
executionEntity
.
setVariable
(
"wfverfield"
,
wfverfield
);
executionEntity
.
setVariable
(
"majortextfield"
,
majortext_field
);
Map
callbackArg
=
new
LinkedHashMap
();
if
(!
StringUtils
.
isEmpty
(
wfinstfield
))
callbackArg
.
put
(
wfinstfield
,
executionEntity
.
getProcessInstanceId
());
...
...
@@ -126,7 +105,29 @@ public class ProcessInstanceListener implements FlowableEventListener {
}
}
}
else
if
(
evt
instanceof
FlowableEntityEventImpl
)
else
if
(
evt
instanceof
FlowableEntityWithVariablesEventImpl
)
{
FlowableEntityWithVariablesEventImpl
event
=
(
FlowableEntityWithVariablesEventImpl
)
evt
;
if
(
event
.
getType
()
==
FlowableEngineEventType
.
TASK_COMPLETED
)
{
TaskEntity
taskEntity
=
(
TaskEntity
)
event
.
getEntity
();
if
(
taskEntity
.
getTaskDefinitionKey
().
startsWith
(
"tid-"
))
{
Object
data
=
taskEntity
.
getVariable
(
"activedata"
);
Object
link
=
taskEntity
.
getVariable
(
"sequenceFlowName"
);
if
(
data
!=
null
&&(
data
instanceof
Map
)&&
link
!=
null
)
{
Map
activedata
=(
Map
)
data
;
String
srfwfmemo
=
""
;
if
(
activedata
.
get
(
"srfwfmemo"
)!=
null
)
srfwfmemo
=
activedata
.
get
(
"srfwfmemo"
).
toString
();
taskService
.
addComment
(
taskEntity
.
getId
(),
taskEntity
.
getProcessInstanceId
(),
link
.
toString
(),
srfwfmemo
);
}
}
}
}
else
if
(
evt
instanceof
FlowableEntityEventImpl
&&
evt
.
getType
()
!=
null
&&
FlowableEngineEventType
.
PROCESS_COMPLETED
==
evt
.
getType
()
)
{
FlowableEntityEventImpl
event
=((
FlowableEntityEventImpl
)
evt
);
FlowableEventType
eventType
=
event
.
getType
();
...
...
@@ -157,10 +158,7 @@ public class ProcessInstanceListener implements FlowableEventListener {
}
System
.
out
.
println
(
"流程结束"
);
}
if
(
eventType
==
FlowableEngineEventType
.
PROCESS_COMPLETED_WITH_ERROR_END_EVENT
){
event
.
getEntity
();
System
.
out
.
println
(
"流程异常结束"
);
}
}
else
if
(
evt
instanceof
FlowableActivityEventImpl
)
{
...
...
@@ -187,20 +185,13 @@ public class ProcessInstanceListener implements FlowableEventListener {
}
}
}
@Override
public
boolean
isFailOnException
()
{
return
fals
e
;
return
tru
e
;
}
@Override
public
boolean
isFireOnTransactionLifecycleEvent
()
{
return
false
;
}
@Override
public
String
getOnTransaction
()
{
return
null
;
}
}
\ No newline at end of file
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
2168b365
...
...
@@ -54,7 +54,10 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.xml.stream.XMLInputFactory
;
import
javax.xml.stream.XMLStreamReader
;
import
java.io.*
;
...
...
@@ -104,7 +107,20 @@ public class WFCoreService
AuthenticationUser
user
=
AuthenticationUser
.
getAuthenticationUser
();
FlowUser
principal
=
new
FlowUser
();
principal
.
setUser
(
user
);
principal
.
setToken
(
"Bearer "
+
jwtTokenUtil
.
generateToken
(
user
));
String
token
=
""
;
ServletRequestAttributes
requestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
)
{
HttpServletRequest
request
=
requestAttributes
.
getRequest
();
Object
tk
=
request
.
getHeader
(
"Authorization"
);
if
(
tk
!=
null
)
token
=
tk
.
toString
();
}
if
(
StringUtils
.
isEmpty
(
token
))
{
token
=
"Bearer "
+
jwtTokenUtil
.
generateToken
(
user
);
}
principal
.
setToken
(
token
);
context
.
setPrincipal
((
Principal
)
principal
);
return
context
;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录