Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
61de0ad1
提交
61de0ad1
编写于
5月 10, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流部署
上级
1e5706f1
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
48 行增加
和
75 行删除
+48
-75
WFCoreService.java
...ava/cn/ibizlab/core/extensions/service/WFCoreService.java
+6
-2
WFModelService.java
...va/cn/ibizlab/core/extensions/service/WFModelService.java
+5
-3
WFProcessDefinitionServicePublishImpl.java
...s/service/impl/WFProcessDefinitionServicePublishImpl.java
+0
-67
WFREModelServiceImpl.java
...zlab/core/workflow/service/impl/WFREModelServiceImpl.java
+37
-3
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/extensions/service/WFCoreService.java
浏览文件 @
61de0ad1
...
...
@@ -377,8 +377,6 @@ public class WFCoreService
String
processDefinitionKey
=
system
+
"-"
+
booking
+
"-"
+
params
[
1
];
WFProcessDefinition
old
=
iwfProcessDefinitionService
.
get
(
processDefinitionKey
);
if
(
md5
.
equals
(
old
.
getMd5check
()))
continue
;
WFProcessDefinition
wfProcessDefinition
=
new
WFProcessDefinition
();
wfProcessDefinition
.
setDefinitionkey
(
processDefinitionKey
);
wfProcessDefinition
.
setDeploykey
(
processDefinitionKey
);
...
...
@@ -402,6 +400,12 @@ public class WFCoreService
entitymodel
.
getProcesses
().
get
(
0
).
setId
(
processDefinitionKey
);
byte
[]
bs
=
bpmnXMLConverter
.
convertToXML
(
entitymodel
);
bmpmfileId
=
DigestUtils
.
md5DigestAsHex
(
bs
);
if
(
bmpmfileId
.
equals
(
old
.
getMd5check
()))
{
log
.
warn
(
"部署流程没有变化,忽略 name:"
+
curProcess
.
getName
()
+
" key "
+
processDefinitionKey
+
" deploy "
+
bmpmfileId
);
continue
;
}
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
bmpmfileId
+
File
.
separator
+
processDefinitionKey
+
".bpmn20.xml"
;
is
=
new
ByteArrayInputStream
(
bs
);
File
file
=
new
File
(
fileFullPath
);
...
...
ibzwf-core/src/main/java/cn/ibizlab/core/extensions/service/WFModelService.java
浏览文件 @
61de0ad1
...
...
@@ -20,6 +20,8 @@ import java.util.*;
public
class
WFModelService
{
@Autowired
private
RepositoryService
repositoryService
;
...
...
@@ -79,11 +81,11 @@ public class WFModelService
return
userTasks
;
}
public
Map
<
String
,
Object
>
getProcessGlobalSetting
(
String
definition
i
d
)
public
Map
<
String
,
Object
>
getProcessGlobalSetting
(
String
definition
I
d
)
{
LinkedHashMap
<
String
,
Object
>
setting
=
new
LinkedHashMap
();
Process
process
=
repositoryService
.
getBpmnModel
(
definition
i
d
).
getMainProcess
();
for
(
ExtensionElement
field:
repositoryService
.
getBpmnModel
(
definitionid
).
getMainProcess
()
.
getExtensionElements
().
get
(
"field"
))
{
Process
process
=
repositoryService
.
getBpmnModel
(
definition
I
d
).
getMainProcess
();
for
(
ExtensionElement
field:
process
.
getExtensionElements
().
get
(
"field"
))
{
if
((!
StringUtils
.
isEmpty
(
field
.
getAttributes
().
get
(
"name"
).
get
(
0
).
getValue
()))&&(!
StringUtils
.
isEmpty
(
field
.
getChildElements
().
get
(
"string"
).
get
(
0
).
getElementText
())))
setting
.
put
(
field
.
getAttributes
().
get
(
"name"
).
get
(
0
).
getValue
(),
field
.
getChildElements
().
get
(
"string"
).
get
(
0
).
getElementText
());
}
...
...
ibzwf-core/src/main/java/cn/ibizlab/core/extensions/service/impl/WFProcessDefinitionServicePublishImpl.java
已删除
100644 → 0
浏览文件 @
1e5706f1
package
cn
.
ibizlab
.
core
.
extensions
.
service
.
impl
;
import
cn.ibizlab.core.extensions.service.WFCoreService
;
import
cn.ibizlab.core.workflow.domain.WFProcessDefinition
;
import
cn.ibizlab.core.workflow.service.impl.WFProcessDefinitionServiceImpl
;
import
cn.ibizlab.util.domain.FileItem
;
import
cn.ibizlab.util.service.FileService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.io.File
;
import
java.util.List
;
@Service
@Primary
public
class
WFProcessDefinitionServicePublishImpl
extends
WFProcessDefinitionServiceImpl
{
@Override
public
boolean
create
(
WFProcessDefinition
et
)
{
if
(!
super
.
create
(
et
))
return
false
;
publish
(
et
);
return
true
;
}
@Override
public
boolean
update
(
WFProcessDefinition
et
)
{
if
(!
super
.
update
(
et
))
return
false
;
publish
(
et
);
return
true
;
}
@Autowired
private
FileService
fileService
;
@Autowired
@Lazy
private
WFCoreService
wfCoreService
;
public
void
publish
(
WFProcessDefinition
et
)
{
if
(
StringUtils
.
isEmpty
(
et
.
getBpmnfile
()))
return
;
String
oldMd5
=
""
;
if
(!
StringUtils
.
isEmpty
(
et
.
getMd5check
()))
oldMd5
=
et
.
getMd5check
();
List
<
FileItem
>
items
=
JSONArray
.
parseArray
(
et
.
getBpmnfile
(),
FileItem
.
class
);
if
(
items
.
size
()==
0
)
return
;
FileItem
item
=
items
.
get
(
items
.
size
()-
1
);
if
(
item
.
getId
().
equals
(
oldMd5
))
return
;
File
bpmnFile
=
fileService
.
getFile
(
item
.
getId
());
if
(!
bpmnFile
.
exists
())
return
;
wfCoreService
.
wfdeploy
(
bpmnFile
);
}
}
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/service/impl/WFREModelServiceImpl.java
浏览文件 @
61de0ad1
package
cn
.
ibizlab
.
core
.
workflow
.
service
.
impl
;
import
java.io.File
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -11,6 +12,11 @@ import java.util.Objects;
import
java.util.Optional
;
import
java.math.BigInteger
;
import
cn.ibizlab.core.extensions.service.WFCoreService
;
import
cn.ibizlab.core.workflow.domain.WFProcessDefinition
;
import
cn.ibizlab.util.domain.FileItem
;
import
cn.ibizlab.util.service.FileService
;
import
com.alibaba.fastjson.JSONArray
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,9 +33,7 @@ import cn.ibizlab.core.workflow.filter.WFREModelSearchContext;
import
cn.ibizlab.core.workflow.service.IWFREModelService
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
org.springframework.util.StringUtils
;
/**
* 实体[流程模型] 无存储服务对象接口实现
...
...
@@ -67,9 +71,39 @@ public class WFREModelServiceImpl implements IWFREModelService {
@Override
public
boolean
create
(
WFREModel
et
)
{
publish
(
et
);
return
true
;
}
@Autowired
private
FileService
fileService
;
@Autowired
@Lazy
private
WFCoreService
wfCoreService
;
public
void
publish
(
WFREModel
et
)
{
if
(
StringUtils
.
isEmpty
(
et
.
getBpmnfile
()))
return
;
List
<
FileItem
>
items
=
JSONArray
.
parseArray
(
et
.
getBpmnfile
(),
FileItem
.
class
);
if
(
items
.
size
()==
0
)
return
;
for
(
FileItem
item:
items
)
{
File
bpmnFile
=
fileService
.
getFile
(
item
.
getId
());
if
(!
bpmnFile
.
exists
())
return
;
wfCoreService
.
wfdeploy
(
bpmnFile
);
}
}
public
void
createBatch
(
List
<
WFREModel
>
list
){
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录