提交 96bdd4df 编写于 作者: Z zhourui

增加优先路由立即执行配置项

上级 94c0a319
...@@ -72,6 +72,7 @@ public class Route extends SliceJpaObject { ...@@ -72,6 +72,7 @@ public class Route extends SliceJpaObject {
@PostLoad @PostLoad
public void postLoad() { public void postLoad() {
this.asyncSupported = this.getProperties().getAsyncSupported(); this.asyncSupported = this.getProperties().getAsyncSupported();
this.soleDirect = this.getProperties().getSoleDirect();
} }
public Route() { public Route() {
...@@ -93,14 +94,26 @@ public class Route extends SliceJpaObject { ...@@ -93,14 +94,26 @@ public class Route extends SliceJpaObject {
return asyncSupported; return asyncSupported;
} }
public Boolean getSoleDirect() {
return soleDirect;
}
public void setAsyncSupported(Boolean asyncSupported) { public void setAsyncSupported(Boolean asyncSupported) {
this.asyncSupported = asyncSupported; this.asyncSupported = asyncSupported;
this.getProperties().setAsyncSupported(asyncSupported); this.getProperties().setAsyncSupported(asyncSupported);
} }
public void setSoleDirect(Boolean soleDirect) {
this.soleDirect = soleDirect;
this.getProperties().setSoleDirect(soleDirect);
}
@Transient @Transient
private Boolean asyncSupported; private Boolean asyncSupported;
@Transient
private Boolean soleDirect;
public static final String name_FIELDNAME = "name"; public static final String name_FIELDNAME = "name";
@FieldDescribe("名称.") @FieldDescribe("名称.")
@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME) @Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
......
package com.x.processplatform.core.entity.element; package com.x.processplatform.core.entity.element;
import org.apache.commons.lang3.BooleanUtils;
import com.x.base.core.entity.JsonProperties; import com.x.base.core.entity.JsonProperties;
import com.x.base.core.project.annotation.FieldDescribe; import com.x.base.core.project.annotation.FieldDescribe;
public class RouteProperties extends JsonProperties { public class RouteProperties extends JsonProperties {
private static final long serialVersionUID = -7792270726211126577L;
@FieldDescribe("是否启用异步返回.") @FieldDescribe("是否启用异步返回.")
private Boolean asyncSupported = true; private Boolean asyncSupported = true;
@FieldDescribe("选择优先路由时是否直接执行路由(一票否决),默认true.")
private Boolean soleDirect;
public Boolean getAsyncSupported() { public Boolean getAsyncSupported() {
return asyncSupported; return asyncSupported;
} }
...@@ -16,4 +23,12 @@ public class RouteProperties extends JsonProperties { ...@@ -16,4 +23,12 @@ public class RouteProperties extends JsonProperties {
this.asyncSupported = asyncSupported; this.asyncSupported = asyncSupported;
} }
public Boolean getSoleDirect() {
return BooleanUtils.isNotFalse(soleDirect);
}
public void setSoleDirect(Boolean soleDirect) {
this.soleDirect = soleDirect;
}
} }
...@@ -453,8 +453,9 @@ public class ManualProcessor extends AbstractManualProcessor { ...@@ -453,8 +453,9 @@ public class ManualProcessor extends AbstractManualProcessor {
boolean passThrough = false; boolean passThrough = false;
// 取得本环节已经处理的已办 // 取得本环节已经处理的已办
List<TaskCompleted> taskCompleteds = this.listJoinInquireTaskCompleted(aeiObjects, identities); List<TaskCompleted> taskCompleteds = this.listJoinInquireTaskCompleted(aeiObjects, identities);
// 存在优先路由,如果有人选择了优先路由那么直接流转. // 存在优先路由,如果有人选择了优先路由那么直接流转.需要判断是否启用了soleDirect
Route soleRoute = aeiObjects.getRoutes().stream().filter(r -> BooleanUtils.isTrue(r.getSole())).findFirst() Route soleRoute = aeiObjects.getRoutes().stream()
.filter(r -> BooleanUtils.isTrue(r.getSole()) && BooleanUtils.isTrue(r.getSoleDirect())).findFirst()
.orElse(null); .orElse(null);
if (null != soleRoute) { if (null != soleRoute) {
TaskCompleted soleTaskCompleted = taskCompleteds.stream() TaskCompleted soleTaskCompleted = taskCompleteds.stream()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册