Hello,
When my subflow ends, i need to write an attribute of a bean which is in the parent flow scope.
Using a bean subclassing a ParametrizableAttribueMapper and referenced in the subflow state, i succeeded. Trying to do the same thing using only xml descriptions of the mapping i get an ognl exception.
Here the code for the mapper defined as a bean and referenced in the subflow state:
the "refavis" is received when the user clicks on a link in a subflow viewCode:public void mapSubflowOutput(RequestContext rc) { String ref=(String)rc.getSourceEvent().getParameter("refavis"); Scope parentScope=rc.getFlowContext().getActiveSession().getParent().getScope(); DemandeAdhesionMensualisation demande=(DemandeAdhesionMensualisation)parentScope.getAttribute("demandeadhesionmensualisation"); demande.getAvisimposition().setReference(ref); super.mapSubflowOutput(rc); } public Map createSubflowInput(RequestContext rc) { DemandeAdhesionMensualisation demande=(DemandeAdhesionMensualisation)rc.getFlowScope().getAttribute("demandeadhesionmensualisation"); String identifiant=demande.getAvisimposition().getContribuableparticulier().getIdentifiant(); rc.getRequestScope().setAttribute("identifiant",identifiant); return super.createSubflowInput(rc); }
<a href="sub.flow?_flowExecutionId=0A&_eventId=select ion&refavis=666">Avis 666</a>
Here the xml that i tried to do the same thing:
Code:<attribute-mapper> <input name="${demandeadhesionmensualisation.avisimposition.contribuableparticulier.identifiant}" as="identifiant"/> <output value="${sourceEvent.parameters.refavis}" as="${demandeadhesionmensualisation.avisimposition.reference}"/> </attribute-mapper>
With this definition, i get an OgnlException for the output arguing that sourceEvent is null. (getProperty(null,parameters)) but the sourceEvent in the java code isn't null... bug ?
Thank you in advance.


Reply With Quote