调整一些接口参数
This commit is contained in:
@@ -142,7 +142,7 @@ public abstract class FlowableManager {
|
||||
throw new IllegalArgumentException("权限检查器为空");
|
||||
}
|
||||
FlowableAccessor accessor = createBean(accessorClass);
|
||||
if (!accessor.access(instance.getMetadata())) {
|
||||
if (!accessor.access(configuration, instance, node, action)) {
|
||||
throw new IllegalArgumentException("权限校验不通过");
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public abstract class FlowableManager {
|
||||
throw new IllegalArgumentException("节点执行器为空");
|
||||
}
|
||||
FlowableHandler handler = createBean(handlerClass);
|
||||
action = handler.handle(instance, node, action);
|
||||
action = handler.handle(configuration, instance, node, action);
|
||||
if (Objects.isNull(action)) {
|
||||
throw new IllegalArgumentException("节点执行结果不能为空");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.lanyuanxiaoyao.flowable.core.model;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
|
||||
/**
|
||||
* 权限校验
|
||||
*
|
||||
@@ -7,11 +9,11 @@ package com.lanyuanxiaoyao.flowable.core.model;
|
||||
* @version 20241231
|
||||
*/
|
||||
public interface FlowableAccessor {
|
||||
boolean access(FlowableMetadata metadata);
|
||||
boolean access(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action);
|
||||
|
||||
class DefaultFlowableAccessor implements FlowableAccessor {
|
||||
@Override
|
||||
public boolean access(FlowableMetadata metadata) {
|
||||
public boolean access(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.lanyuanxiaoyao.flowable.core.model;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
|
||||
/**
|
||||
* 处理器
|
||||
*
|
||||
@@ -7,11 +9,11 @@ package com.lanyuanxiaoyao.flowable.core.model;
|
||||
* @version 20250103
|
||||
*/
|
||||
public interface FlowableHandler {
|
||||
FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action);
|
||||
FlowableAction handle(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action);
|
||||
|
||||
class DefaultFlowableHandler implements FlowableHandler {
|
||||
@Override
|
||||
public FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
public FlowableAction handle(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.flowable.core.model;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.helper.ListHelper;
|
||||
import com.lanyuanxiaoyao.flowable.core.helper.MapHelper;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -31,10 +32,11 @@ public class FlowableNode {
|
||||
|
||||
@Builder.Default
|
||||
private final String accessor = FlowableAccessor.DefaultFlowableAccessor.class.getName();
|
||||
private final List<String> listeners;
|
||||
@Builder.Default
|
||||
private final List<String> listeners = ListHelper.empty();
|
||||
|
||||
@Builder.Default
|
||||
private final LocalDateTime createdTime = LocalDateTime.now();
|
||||
|
||||
@Builder.Default
|
||||
private LocalDateTime updatedTime = LocalDateTime.now();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user