Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Flow Process

This article explains the order the various elements of Flow are called.


1. Entry Pipeline calls JS function
2. (optional) JS function loads data
3. JS function calls DisplayForm pipeline
4. DisplayForm Pipeline sends page to visitor
5. Visitor submits page
6. Continuation Pipeline returns to JS
7. JS validation, loop to #3 if necessary
8. JS saves data
9. JS calls Exit Pipeline
10. Exit Pipeline sends confirmation to visitor


Resource for finishing forms:
<map:resource name="form-finish">
<map:transform type="forms"/>
<map:transform src="formfixer.xsl">
<map:parameter name="language" value="{page-envelope:document-language}"/>
<map:transform src="../../resources/forms/forms-samples-styling.xsl"/>
<map:transform type="i18n">
<map:parameter name="locale" value="{page-envelope:document-language}"/>
<map:serialize type="xml" />

- FormFixer is available here.
- forms-samples-styling.xsl is from Cocoon's Forms Block. Copy the file to the directory specified.
Where is JavaScript code:
<map:flow language="javascript">
<map:script src="code.js"/>

Continuation Pipeline
<map:match pattern="**/*_*.more">
<map:call continuation="{2}"/>

Entry pipeline:
<map:call function="myFunction"/>
DisplayForm pipeline:
<map:match pattern="displayform">
<map:generate src="template.xml"/>
<map:call resource="form-finish"/>

Exit pipeline
<map:match pattern="success">
<map:generate type="jx" src="success.xml"/>
<map:call resource="form-finish"/>

JavaScript "code.js"


function myFunction(){
var form = new Form("form.xml");
var model = form.getModel();
//load data
model.myField = "data";
var done = false;
model = form.getModel();
myField = "";
if(model.myfield != null){
myField = new;
done = true;
if(myfield.length == 0) done = false;
}while (!done);
// save data
cocoon.sendPage("success", {"myfield":myfield});

<< SetupLanguage >>

Contact Solprovider
Paul Ercolino