调整一些接口参数
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
package com.lanyuanxiaoyao.flowable.test.accessor;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAccessor;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableMetadata;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250103
|
||||
*/
|
||||
@Slf4j
|
||||
public class RoleCheckAccessor implements FlowableAccessor {
|
||||
@Override
|
||||
public boolean access(FlowableMetadata metadata) {
|
||||
public boolean access(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
FlowableMetadata metadata = instance.getMetadata();
|
||||
return metadata.containsKey("role");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.flowable.test.handler;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableHandler;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
|
||||
@@ -18,7 +19,7 @@ public class TwoApproveHandler implements FlowableHandler {
|
||||
private static final String KEY = "approve-times";
|
||||
|
||||
@Override
|
||||
public FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
public FlowableAction handle(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
log.info("{}", instance.getMetadata());
|
||||
FlowableMetadata metadata = instance.getMetadata();
|
||||
int approveCount = metadata.getIntOrDefault(KEY, 0);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.flowable.test;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableHandler;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
|
||||
@@ -13,7 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class SimpleAutoHandler implements FlowableHandler {
|
||||
@Override
|
||||
public FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
public FlowableAction handle(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
log.info("Simple handler initial");
|
||||
return FlowableAction.APPROVE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user