Spring Webflow,从任意子流程返回主流程
我试图通过单击按钮从任何子流程返回到春季的主要流程。
当我使用
时,它只会转到上一个流程,这也是应用程序中的子流程。
有什么想法吗?
I'm trying to return to my main flow in spring, from any of my subflows just by clicking a button.
when I use <end-state>
it just goes to the previous flow, which is also a sub-flow in the application.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需要在调用流程中的每个子流程状态中进行适当的转换即可执行您想要的操作。子流程中的最终状态 ID 将用作您可以在调用流程中进行转换的事件 ID。
子流程可以被认为是执行的一个分支。因此,当子流程完成时,控制权将返回到调用流程。将您的最终状态视为返回语句(并将 id 属性视为返回的值 - 您还可以设置输出属性,但这在这里并不重要)。
当子流终止时,控制权将返回到调用流。调用流程应定义一个转换来确定如何处理此事件。您将看到的事件 ID 是子流程中最终状态的 ID。
因此,在您的子流程中,如果您有以下最终状态:
您可以在调用该子流程的流程中处理此转换:
请注意,这里的某些状态也可以是最终状态。您的情况听起来好像您有一个主流程调用一个子流程,而子流程又调用另一个子流程。因此,您希望 some-state 成为最终状态,然后由其调用流程(在您的情况下为“主”流程)处理。
You just need the appropriate transitions in each subflow-state in the calling flow to do what you want. The end-state id in your subflow is what will be used as the event id you can transition on in your calling flow.
A subflow can be thought of as a branch of execution. So when your subflow is finished, control is returned back to the calling flow. Think of your end-state as a return statement (and the id attribute as the value returned -- you can also set output attributes but that is not important here).
When your subflow terminates, control is returned backed to the calling flow. The calling flow should define a transition that determines how to handle this event. The event id you will see is the id of the end-state in your subflow.
So in your subflow if you have the following end-state:
You can then handle this transition in the flow that called the subflow:
Note that some-state here can also be an end-state. Your situation sounds like you have a main flow that calls a subflow which in turn calls another subflow. So you would want some-state to be an end-state, which would then be handled by its calling flow (in your case the "main" flow).
您可以通过在定义子流程时添加“父”属性来实现此目的,如下所示,
我希望我的子流程通过后退按钮“单击”返回到登录页面。
需要注意的一件事是,在您的父 flow.xml 中,您需要指定
我的父视图的绝对路径,即下面给出的 login-flow.xml
You can achieve this by adding the 'parent' attribute when you define your sub flow like this
here i want my subflow to return to the login page on a back button 'click' .
One thing to notice is that in your parent flow.xml u need to specify the absolute path of the view
my parent ie login-flow.xml is given below