【问题标题】:global transition on exception and transition not found异常和未找到转换的全局转换
【发布时间】:2014-11-21 01:17:22
【问题描述】:

我有 3 个弹簧网络流 - flow1、flow2、flow3。 flow2 和 flow 3 已经像这样分配了父 flow1 :

<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.0.xsd"
  parent="flow1">

在 flow1 中,我有一个全局转换和一个结束状态:

<end-state id="flowInterrupted" view="flowInterruptedPage"/>

<global-transitions>
    <transition on-exception="com.core.exceptions.policy.InvalidPolicyContactException" to="flowInterrupted">
        <evaluate expression="webFlowService.clearCurrentInterruptCause()"/>
    </transition>
</global-transitions>

在我的应用程序的某个时刻,在 flow2 中调用了一个子流 flow3

<subflow-state id="stateInFlow2WhereSubFlow3IsDefined" subflow="flow3">

</subflow-state>

,在 flow3 中,抛出 InvalidPolicyContactException。它在 flow1 中正确找到(因为它的 get's to clearCurrentInterruptCause())但后来抛出异常,在 flow2 中找不到 flowInterrupted 转换 - 这是真的,因为它在 flow1 中(定义了全局转换)。这是一个例外:

org.springframework.webflow.engine.NoMatchingTransitionException: No      transition found on occurence of event 'flowInterrupted'  in state 'stateInFlow2WhereSubFlow3IsDefined' of flow 'flow2' -- valid transitional criteria are array<TransitionCriteria>[exit, contactSelected] -- likely programmer error, check the set of TransitionCriteria for this state at org.springframework.webflow.engine.TransitionableState.getRequiredTransition(TransitionableState.java:93) at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
at org.springframework.webflow.engine.SubflowState.handleEvent(SubflowState.java:116)
at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388)
at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.endActiveFlowSession(FlowExecutionImpl.java:412)
at org.springframework.webflow.engine.impl.RequestControlContextImpl.endActiveFlowSession(RequestControlContextImpl.java:238)

当我将结束状态 id="flowInterrupted" 更改为视图状态时,它工作正常。当它从其他流中调用时,以 flow1 作为父流也可以正常工作。当我从 flow3 中删除 parent=flow1 时,我不会在全局转换中捕获异常。唯一的问题是,当子流引发异常时。

任何帮助将不胜感激 - 我当然可以将 flowInterrupted 状态放入 flow2 并解决问题,但我想了解为什么会发生这种情况

谢谢。

【问题讨论】:

    标签: spring spring-webflow


    【解决方案1】:

    添加 &lt;transition on="flowInterrupted" to="flowInterrupted"/&gt; 在您的全球转型中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-10
      • 2020-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-02
      • 2013-03-06
      相关资源
      最近更新 更多