gpt4 book ai didi

java - 检查子流程是否有输入

转载 作者:太空宇宙 更新时间:2023-11-04 07:27:15 24 4
gpt4 key购买 nike

我有 Flow 正在调用带有不需要的输入变量的子流。如果我的子流程有输入,我如何检查子流程?

所以这可能是我的流程:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.4.xsd ">

<subflow-state id="withoutInput" subflow="ReportEinlesen" >
<transition on="ende" to="ReportUebersichtAnzeigen" />
</subflow-state>

<decision-state id="somecondition">
<if test="some condition" then="withnput" else="ende" />
</decision-state>

<subflow-state id="withInput" subflow="ReportEinlesen" >
<input name="Report" value="${Report.foo()}" />
<transition on="ende" to="ReportUebersichtAnzeigen" />
</subflow-state>

<end-state id="ende" />
</flow>

这可能是我名为 ReportEinlesen 的子流程:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.4.xsd ">

<decision-state id="anothercondition">
<if test="has this subflow got input?" then="ShowYourInput" else="ende" />
</decision-state>

<view-state id="ShowYourInput" >
<transition on="Seen" to="ende" />
</view-state>

<end-state id="ende" />
</flow>

最佳答案

创建一个委托(delegate)方法并传递输入变量,然后检查它是否为null

关于java - 检查子流程是否有输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18352880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com