Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
da16be9a
提交
da16be9a
编写于
2月 25, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
动态工作流
上级
ed4bc325
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
42 行增加
和
9 行删除
+42
-9
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+30
-9
WFModelService.java
...zlab/core/workflow/extensions/service/WFModelService.java
+5
-0
WFCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
+7
-0
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
da16be9a
package
cn
.
ibizlab
.
core
.
workflow
.
extensions
.
service
;
import
cn.ibizlab.core.workflow.extensions.domain.FlowUser
;
import
cn.ibizlab.core.workflow.domain.*
;
import
cn.ibizlab.core.workflow.extensions.domain.FlowUser
;
import
cn.ibizlab.core.workflow.filter.WFTaskSearchContext
;
import
cn.ibizlab.core.workflow.mapper.WFCoreMapper
;
import
cn.ibizlab.core.workflow.service.IWFGroupService
;
import
cn.ibizlab.core.workflow.service.IWFProcessDefinitionService
;
import
cn.ibizlab.core.workflow.service.IWFTaskService
;
import
cn.ibizlab.core.workflow.service.IWFUserService
;
import
cn.ibizlab.util.client.IBZUAAFeignClient
;
import
cn.ibizlab.util.domain.MsgBody
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.RuleUtils
;
import
cn.ibizlab.util.security.AuthTokenUtil
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.service.RemoteService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.flowable.bpmn.BpmnAutoLayout
;
import
org.flowable.bpmn.converter.BpmnXMLConverter
;
import
org.flowable.bpmn.model.*
;
...
...
@@ -77,8 +72,6 @@ import java.security.Principal;
import
java.sql.Timestamp
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.stream.Collectors
;
@Service
(
"wfCoreService"
)
@Slf4j
...
...
@@ -151,6 +144,9 @@ public class WFCoreService
return
context
;
}
public
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
dynamic
,
String
system
,
String
appname
,
String
entity
)
{
return
wfModelService
.
getDynamicWorkflow
(
dynamic
,
system
,
entity
);
}
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
appname
,
String
entity
)
{
...
...
@@ -806,6 +802,7 @@ public class WFCoreService
curProcess
=
model
.
getMainProcess
();
String
bookings
=
""
;
String
refgroups
=
""
;
String
dynainstid
=
getDynainstId
();
if
(!
curProcess
.
getExtensionElements
().
containsKey
(
"field"
))
{
log
.
error
(
bpmnFileName
+
"没有实体订阅"
);
...
...
@@ -901,7 +898,12 @@ public class WFCoreService
boolean
bchange
=
false
;
for
(
String
booking:
bookings
.
split
(
","
))
{
String
processDefinitionKey
=
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
String
processDefinitionKey
;
if
(!
StringUtils
.
isEmpty
(
dynainstid
))
processDefinitionKey
=
"dyna-"
+
dynainstid
+
"-"
+
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
else
processDefinitionKey
=
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
WFProcessDefinition
old
=
iwfProcessDefinitionService
.
get
(
processDefinitionKey
);
WFProcessDefinition
wfProcessDefinition
=
new
WFProcessDefinition
();
wfProcessDefinition
.
setDefinitionkey
(
processDefinitionKey
);
...
...
@@ -1302,4 +1304,23 @@ public class WFCoreService
}
}
}
/**
* 获取动态实例标识
* @return
*/
private
String
getDynainstId
(){
String
dynainstid
=
null
;
if
(
RequestContextHolder
.
getRequestAttributes
()==
null
&&
!(
RequestContextHolder
.
getRequestAttributes
()
instanceof
ServletRequestAttributes
)){
return
null
;
}
ServletRequestAttributes
requestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
)
{
HttpServletRequest
request
=
requestAttributes
.
getRequest
();
if
(
request
!=
null
&&
!
StringUtils
.
isEmpty
(
request
.
getHeader
(
"dynainstid"
))){
dynainstid
=
request
.
getHeader
(
"dynainstid"
);
}
}
return
dynainstid
;
}
}
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFModelService.java
浏览文件 @
da16be9a
...
...
@@ -27,6 +27,11 @@ public class WFModelService
@Autowired
private
IWFProcessDefinitionService
iwfProcessDefinitionService
;
public
List
<
WFProcessDefinition
>
getDynamicWorkflow
(
String
dynamic
,
String
system
,
String
entity
)
{
return
iwfProcessDefinitionService
.
list
(
new
QueryWrapper
<
WFProcessDefinition
>().
likeRight
(
"definitionkey"
,
"dyna-"
+
dynamic
+
"-"
+
system
+
"-"
+
entity
+
"-"
).
eq
(
"modelenable"
,
1
).
orderByDesc
(
"modelversion"
));
}
public
List
<
WFProcessDefinition
>
getWorkflow
(
String
system
,
String
entity
)
{
return
iwfProcessDefinitionService
.
list
(
new
QueryWrapper
<
WFProcessDefinition
>().
likeRight
(
"definitionkey"
,
system
+
"-"
+
entity
+
"-"
).
eq
(
"modelenable"
,
1
).
orderByDesc
(
"modelversion"
));
...
...
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
浏览文件 @
da16be9a
...
...
@@ -51,6 +51,13 @@ public class WFCoreResource
@Lazy
public
WFTaskMapping
wfTaskMapping
;
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据系统实体查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{dynainstid}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getDynaWorkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
@PathVariable
(
"dynainstid"
)
String
dynamic
,
@PathVariable
(
"entity"
)
String
entity
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynamicWorkflow
(
dynamic
,
system
,
appname
,
entity
));
}
@ApiOperation
(
value
=
"getWFProcessDefinition"
,
tags
=
{
"WFProcessDefinition"
},
notes
=
"根据系统实体查找当前适配的工作流模型"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}-app-{appname}/{entity}/process-definitions"
)
public
ResponseEntity
<
List
<
WFProcessDefinition
>>
getworkflow
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录