Results 1 to 5 of 5

Thread: flowRedirect used in endstate of a subflow

  1. #1
    Join Date
    Sep 2005
    Posts
    15

    Default flowRedirect used in endstate of a subflow

    Hi,

    I need to redirect to a new flow from a subflow, using this syntax in the subFlow :

    <end-state id="dossierrecapbeneficiaire"
    view="flowRedirect:consulterundossierbeneficiaire-flow?reference=${flowScope.objetformulaire.lePensi onne.representantLegal.beneficiaire.reference}">

    </end-state>


    It doesn't work and I get an exception which says there is no transition for "dossierrecapbeneficiaire" in the subflow state of the parent flow.

    Is there a way to end both subflow and parent flow from the endstate of a subFlow, redirecting to a new created flow ?

    Thanks
    Wenceslas
    Wenceslas

  2. #2
    Join Date
    May 2008
    Posts
    53

    Default

    Try leaving the end-state in the subflow without the redirect and instead do the redirect in the calling flow

    SubFlow:
    Code:
    <end-state id="dossierrecapbeneficiaire"/>
    Calling Flow:
    Code:
    <subflow-state id="callSubFlow" subflow="thesubflowname">
      <transition on="dossierrecapbeneficiaire" to="dossierrecapbeneficiaire"/>
    </subflow>
    
    <end-state id="dossierrecapbeneficiaire" view="flowRedirect:consulterundossierbeneficiaire-flow?reference=${flowScope.objetformulaire.lePensi onne.representantLegal.beneficiaire.reference}">
    </end-state>

  3. #3
    Join Date
    Nov 2008
    Posts
    742

    Default

    Yes, philwebb has the right idea.

    The "view" attribute of an end-state is ignored if it is within a subflow. Only in the top-level flow will an end-state's "view" attribute get evaluated.

  4. #4
    Join Date
    Sep 2005
    Posts
    15

    Default Use of view-state instead of end-state

    Thanks for your help, but I don't want to put in the root state any state related to a child flow.

    I use a view-state instead of a end-state to do the redirection (It is not a perfect solution because the flow is not terminated and leave in the repository until the user session has reached the maximum of flow it can keep alive).


    Wenceslas
    Wenceslas

  5. #5
    Join Date
    Sep 2010
    Posts
    11

    Default

    I think that you can't use an end-state with redirect from a subflow. Syntax let do it, but doesn't work.
    As you say, using a view-state, the subFlow is not terminated and parent flow too. A solution could be return to the parent flow, using conversationScope to send a param from subflow to parent flow. Then, parent flow, process this param and transits to end-state with the flowRedirect instruction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •