mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
Merge branch 'master' of https://gitee.com/dromara/liteFlow into issues/I8MXHX
This commit is contained in:
@@ -16,7 +16,7 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum;
|
||||
public class AndOperator extends BaseOperator<AndOrCondition> {
|
||||
@Override
|
||||
public AndOrCondition build(Object[] objects) throws Exception {
|
||||
OperatorHelper.checkObjectSizeGtTwo(objects);
|
||||
OperatorHelper.checkObjectSizeGteTwo(objects);
|
||||
|
||||
AndOrCondition andOrCondition = new AndOrCondition();
|
||||
andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.AND);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class MustOperator extends BaseOperator<WhenCondition> {
|
||||
|
||||
@Override
|
||||
public WhenCondition build(Object[] objects) throws Exception {
|
||||
OperatorHelper.checkObjectSizeGtTwo(objects);
|
||||
OperatorHelper.checkObjectSizeGteTwo(objects);
|
||||
|
||||
String errorMsg = "The caller must be WhenCondition item";
|
||||
WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg);
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum;
|
||||
public class OrOperator extends BaseOperator<AndOrCondition> {
|
||||
@Override
|
||||
public AndOrCondition build(Object[] objects) throws Exception {
|
||||
OperatorHelper.checkObjectSizeGtTwo(objects);
|
||||
OperatorHelper.checkObjectSizeGteTwo(objects);
|
||||
|
||||
AndOrCondition andOrCondition = new AndOrCondition();
|
||||
andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.OR);
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ToOperator extends BaseOperator<SwitchCondition> {
|
||||
|
||||
@Override
|
||||
public SwitchCondition build(Object[] objects) throws Exception {
|
||||
OperatorHelper.checkObjectSizeGtTwo(objects);
|
||||
OperatorHelper.checkObjectSizeGteTwo(objects);
|
||||
|
||||
String errorMsg = "The caller must be SwitchCondition item";
|
||||
SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class, errorMsg);
|
||||
|
||||
@@ -10,8 +10,6 @@ import com.yomahub.liteflow.exception.DataNotFoundException;
|
||||
import com.yomahub.liteflow.flow.element.Condition;
|
||||
import com.yomahub.liteflow.flow.element.Executable;
|
||||
import com.yomahub.liteflow.flow.element.Node;
|
||||
import com.yomahub.liteflow.flow.element.condition.AndOrCondition;
|
||||
import com.yomahub.liteflow.flow.element.condition.NotCondition;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -35,13 +33,13 @@ public class OperatorHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查参数数量,大于 2
|
||||
* 检查参数数量,大于等于 2
|
||||
* @param objects objects
|
||||
* @throws QLException QLException
|
||||
*/
|
||||
public static void checkObjectSizeGtTwo(Object[] objects) throws QLException {
|
||||
public static void checkObjectSizeGteTwo(Object[] objects) throws QLException {
|
||||
checkObjectSizeGtZero(objects);
|
||||
if (objects.length <= 1) {
|
||||
if (objects.length < 2) {
|
||||
throw new QLException("parameter error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,11 @@ public class DeclBeanDefinition implements BeanDefinitionRegistryPostProcessor {
|
||||
|
||||
beanDefinitionHolderMap.entrySet().stream().filter(entry -> {
|
||||
Class<?> rawClass = entry.getValue().getResolvableType().getRawClass();
|
||||
return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null);
|
||||
if (rawClass == null){
|
||||
return false;
|
||||
}else{
|
||||
return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null);
|
||||
}
|
||||
}).forEach(entry -> {
|
||||
Class<?> rawClass = entry.getValue().getResolvableType().getRawClass();
|
||||
List<DeclWarpBean> declWarpBeanList = DeclComponentParserHolder.loadDeclComponentParser().parseDeclBean(rawClass);
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -39,7 +39,7 @@
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<revision>2.11.4</revision>
|
||||
<revision>2.11.4.1</revision>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
||||
Reference in New Issue
Block a user