Return from Flow

Flow passes control back to an XMAP using sendPage().
cocoon.sendPage("flowReturnPipeline");
}The pipeline must exist in the calling XMAP.

The pipeline name can use the querystring.
cocoon.sendPage("flowReturn?name=" + name);

This is useful for communication with the XMAP. Do not use this method for information that can be hardcoded:
if(passed){
cocoon.sendPage("flowSuccess?name=" + name);
}else{
cocoon.sendPage("flowFailure?name=" + name);
}

Using Return Value in XMAP

The next Pipeline must be complete, starting with a Generator or Aggregator. I know of no method of passing XML results from Flow back to the XMAP. The only control is which pipeline is called, and using the querystring with the pipeline name to set values.

We used this code to force the login for new registrations:
cocoon.sendPage("flowReturn?name=" + name); <map:match pattern="login-success-pipeline">
<map:act type="authenticator"/>
<map:redirect-to uri="/{page-envelope:publication-id}/live/index_{page-envelope:document-language}.html?lenya.usecase=session"/>
</map:match>

WORK: Add example of using the returned value for controlling execution in the XMAP.
WORK: Discuss the "values" format if it is useful: cocoon.sendPage("contact-success", {"name":name});

One solution is to repeat the Pipeline called by Flow (using a Resource for the common elements), then continue with an XSLT processing based on the return value to change the XML.