【问题标题】:Check if subflow has input检查子流是否有输入
【发布时间】:2013-08-21 18:16:41
【问题描述】:

我有 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>

【问题讨论】:

    标签: java spring spring-webflow spring-webflow-2


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-07-19
      • 2012-10-27
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-18
      相关资源
      最近更新 更多