geideon
Jun 10th, 2005, 07:15 AM
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:
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.getFlowS cope().getAttribute("demandeadhesionmensualisation");
String identifiant=demande.getAvisimposition().getContrib uableparticulier().getIdentifiant();
rc.getRequestScope().setAttribute("identifiant",identifiant);
return super.createSubflowInput(rc);
}
the "refavis" is received when the user clicks on a link in a subflow view
<a href="sub.flow?_flowExecutionId=0A&_eventId=selection&refavis=666">Avis 666</a>
Here the xml that i tried to do the same thing:
<attribute-mapper>
<input name="${demandeadhesionmensualisation.avisimposition.con tribuableparticulier.identifiant}" as="identifiant"/>
<output value="${sourceEvent.parameters.refavis}" as="${demandeadhesionmensualisation.avisimposition.ref erence}"/>
</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.
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:
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.getFlowS cope().getAttribute("demandeadhesionmensualisation");
String identifiant=demande.getAvisimposition().getContrib uableparticulier().getIdentifiant();
rc.getRequestScope().setAttribute("identifiant",identifiant);
return super.createSubflowInput(rc);
}
the "refavis" is received when the user clicks on a link in a subflow view
<a href="sub.flow?_flowExecutionId=0A&_eventId=selection&refavis=666">Avis 666</a>
Here the xml that i tried to do the same thing:
<attribute-mapper>
<input name="${demandeadhesionmensualisation.avisimposition.con tribuableparticulier.identifiant}" as="identifiant"/>
<output value="${sourceEvent.parameters.refavis}" as="${demandeadhesionmensualisation.avisimposition.ref erence}"/>
</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.