1
0

调整一些接口参数

This commit is contained in:
2025-01-03 17:05:35 +08:00
parent bca3933790
commit 6d869ef915
9 changed files with 40 additions and 15 deletions

View File

@@ -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");
}
}

View File

@@ -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);

View File

@@ -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;
}