Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
292a0e7c
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
292a0e7c
编写于
9月 07, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
795add76
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
45 deletion
+49
-45
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessing.java
...tform/service/processing/jaxrs/work/ActionProcessing.java
+49
-45
未找到文件。
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessing.java
浏览文件 @
292a0e7c
...
...
@@ -2,30 +2,38 @@ package com.x.processplatform.service.processing.jaxrs.work;
import
java.util.concurrent.Callable
;
import
org.apache.commons.lang3.
String
Utils
;
import
org.apache.commons.lang3.
Boolean
Utils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.executor.ProcessPlatformExecutorFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.log.SignalStackLog
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.ProcessingSignal
;
import
com.x.processplatform.service.processing.Processing
;
import
com.x.processplatform.service.processing.ThisApplication
;
class
ActionProcessing
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionProcessing
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
String
job
;
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
wi
.
setDebugger
(
effectivePerson
.
getDebugger
());
...
...
@@ -40,72 +48,68 @@ class ActionProcessing extends BaseAction {
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
result
.
setData
(
new
Wo
());
try
{
open
(
id
,
wi
);
Wo
wo
=
ProcessPlatformExecutorFactory
.
get
(
job
).
submit
(
new
CallableExecute
(
wi
,
id
)).
get
();
persistSignalStack
(
id
,
job
,
wi
);
result
.
setData
(
wo
);
return
result
;
}
finally
{
close
(
id
,
wi
);
}
}
ProcessPlatformExecutorFactory
.
get
(
job
).
submit
(
new
CallableExecute
(
wi
,
id
,
result
));
private
void
open
(
String
id
,
Wi
wi
)
{
ThisApplication
.
getProcessingToProcessingSignalStack
().
open
(
id
,
wi
.
getSeries
(),
wi
.
getSignalStack
());
}
String
value
=
wi
.
signal
().
read
();
private
void
close
(
String
id
,
Wi
wi
)
{
ThisApplication
.
getProcessingToProcessingSignalStack
().
close
(
id
,
wi
.
getSeries
());
}
if
(
StringUtils
.
isNotBlank
(
value
))
{
result
.
getData
().
setId
(
id
);
result
.
getData
().
setOccurProcessingSignal
(
true
);
result
.
getData
().
setProcessingSignal
(
gson
.
fromJson
(
value
,
ProcessingSignal
.
class
));
return
result
;
}
else
{
return
result
;
private
void
persistSignalStack
(
String
id
,
String
job
,
Wi
wi
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
processPlatform
().
getProcessingSignalPersistEnable
()))
{
return
;
}
new
Thread
(()
->
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
emc
.
beginTransaction
(
SignalStackLog
.
class
);
SignalStackLog
log
=
new
SignalStackLog
(
id
,
job
,
wi
.
getSignalStack
());
emc
.
persist
(
log
,
CheckPersistType
.
all
);
emc
.
commit
();
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
}).
start
();
}
private
class
CallableExecute
implements
Callable
<
ActionResult
<
Wo
>
>
{
private
class
CallableExecute
implements
Callable
<
Wo
>
{
private
Wi
wi
;
private
String
id
;
private
ActionResult
<
Wo
>
result
;
private
CallableExecute
(
Wi
wi
,
String
id
,
ActionResult
<
Wo
>
result
)
{
private
CallableExecute
(
Wi
wi
,
String
id
)
{
this
.
wi
=
wi
;
this
.
id
=
id
;
this
.
result
=
result
;
}
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
public
Wo
call
()
throws
Exception
{
Processing
processing
=
new
Processing
(
wi
);
processing
.
processing
(
id
);
result
.
getData
().
setId
(
id
);
return
result
;
Wo
wo
=
new
Wo
();
wo
.
setId
(
id
);
return
wo
;
}
}
public
static
class
Wi
extends
ProcessingAttributes
{
private
static
final
long
serialVersionUID
=
-
7448961581565944869L
;
}
public
static
class
Wo
extends
WoId
{
@FieldDescribe
(
"是否发生流程信号."
)
private
Boolean
occurProcessingSignal
=
false
;
@FieldDescribe
(
"流程信号."
)
private
ProcessingSignal
processingSignal
;
public
Boolean
getOccurProcessingSignal
()
{
return
occurProcessingSignal
;
}
public
void
setOccurProcessingSignal
(
Boolean
occurProcessingSignal
)
{
this
.
occurProcessingSignal
=
occurProcessingSignal
;
}
public
ProcessingSignal
getProcessingSignal
()
{
return
processingSignal
;
}
public
void
setProcessingSignal
(
ProcessingSignal
processingSignal
)
{
this
.
processingSignal
=
processingSignal
;
}
private
static
final
long
serialVersionUID
=
3933030965024291084L
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录