!347 bug:#ID22LR 当 Chain 和 组件 同名时 栈溢出

Merge pull request !347 from jay-li/dev
This commit is contained in:
铂赛东
2025-10-17 06:14:16 +00:00
committed by Gitee
3 changed files with 13 additions and 1 deletions

View File

@@ -363,7 +363,7 @@ public class LiteFlowChainELBuilder {
String[] itemArray = EXPRESS_RUNNER.getOutVarNames(chain.getEl());
Arrays.stream(itemArray).forEach(item -> {
if (FlowBus.containChain(item)){
if (FlowBus.containChain(item) && !chain.getChainId().equals(item)) {
Chain itemChain = FlowBus.getChain(item);
if (!itemChain.isCompiled()){
buildUnCompileChain(FlowBus.getChain(item));

View File

@@ -69,4 +69,12 @@ public class LiteflowXmlScriptQLExpressELParseModeTest extends BaseTest {
}
}
}
// china 和组件 同名 爆栈
@Test
public void testScript1() {
LiteflowResponse response = flowExecutor.execute2Resp("a", "arg");
Assertions.assertTrue(response.isSuccess());
Assertions.assertEquals("a==>b==>c", response.getExecuteStepStrWithoutTime());
}
}

View File

@@ -37,4 +37,8 @@
<chain name="chain2">
THEN(d,SWITCH(s2).to(a,b));
</chain>
<chain name="a">
THEN(a,b,c);
</chain>
</flow>