初步完成 liteflow-solon-plugin 适配

This commit is contained in:
noear
2022-12-22 12:46:01 +08:00
parent 77d2c12485
commit e579540e3a
13 changed files with 79 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
package com.yomahub.liteflow.solon;
import org.noear.solon.Utils;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
@@ -84,7 +85,11 @@ public class LiteflowProperty {
}
public void setRuleSource(String ruleSource) {
this.ruleSource = ruleSource;
if (ruleSource.contains("*")) {
this.ruleSource = String.join(",", Utils.resolvePaths(ruleSource));
} else {
this.ruleSource = ruleSource;
}
}
public int getSlotSize() {

View File

@@ -48,19 +48,18 @@ public class XPluginImpl implements Plugin {
node1.setNodeId(nodeId);
node1.setType(anno.nodeType());
FlowBus.addSpringScanNode(bw.name(), node1);
FlowBus.addSpringScanNode(nodeId, node1);
});
context.beanBuilderAdd(LiteflowComponent.class, (clz, bw, anno) -> {
if(NodeComponent.class.isAssignableFrom(clz)) {
NodeComponent node1 = bw.raw();
String id1 = Utils.annoAlias(anno.id(), anno.value());
String name1 =Utils.annoAlias(anno.name(), id1);
String nodeId = Utils.annoAlias(anno.id(), anno.value());
node1.setNodeId(id1);
node1.setName(name1);
node1.setNodeId(nodeId);
node1.setName(anno.name());
FlowBus.addSpringScanNode(node1.getNodeId(), node1);
FlowBus.addSpringScanNode(nodeId, node1);
}else{
context.beanExtract(bw); //尝试提取 LiteflowMethod 函数
}