Announcement Announcement Module
Collapse
No announcement yet.
Quick question about subflows Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick question about subflows

    When I define a subflow, what does the "transition on='something' to='myAction'" actually mean?

    Does it mean that if the transition "something" is every called in the subflow then myAction will be executed? So if the transition "something" is called halfway through the subflow, the subflow will stop halfway through?

    Or are the subflow "end-state"s substituted for the specified transition?

    Sorry if it is a really dumb question; just trying to get me head around it

  • #2
    Are you talking about from a subflow state definition?

    A subflow state spawns a subflow. That causes the parent flow to suspend and the subflow takes control. When the subflow ends, the parent flow resumes in the same subflow state, only this time uses the ending result of the subflow as grounds for a transition out of the resumed state.

    so we say the parent flow responds to the ending result of the subflow. The ending event ID is the ID of the end state in the subflow that was reached.

    see the javadocs for SubflowState and EndState for more info.

    Keith

    Comment


    • #3
      The thing that confused me was the fact that you specify "transition" elements in a subflow-state. That kind of implies the "transition" in the subflow are replaced:

      Code:
        <subflow-state id="deleteChild.action" flow="deletePageFlow" >
          <attribute-mapper>
            <input value="$&#123;requestScope.page.parent&#125;" as="parent"/>
          </attribute-mapper>
          <transition on="pageDeleted.view" to="navigateToParent.action"/>
        </subflow-state>
      Would it not be more explicit to specify end-state in the subflow-state:

      Code:
        <subflow-state id="deleteChild.action" flow="deletePageFlow" >
          <attribute-mapper>
            <input value="$&#123;requestScope.page.parent&#125;" as="parent"/>
          </attribute-mapper>
          <end-state id="pageDeleted.view" to="navigateToParent.action"/>
        </subflow-state>
      Just a thought. I did look in the phoneBook example, but the action name and the end-state are both called "end"

      Thanks Keith.

      Comment

      Working...
      X