cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ulf Sahlin" <ulf.sah...@s2communications.se>
Subject Re: Creating and halting flow continuations
Date Thu, 09 Sep 2004 14:46:40 GMT
Hi!

> > It seems it's FOM_Cocoon.suicide(); that halts execution (duh). I tried
> > using this:
> >
> > function testingSome() {
> >
> >     var c = cocoon.createWebContinuation();
> >     print("Continuation = " + c.id);
> >     FOM_Cocoon.suicide();
> >     print("Continued executing.");
> > }
>
> This will not work indeed. cocoon.createWebContinuation() will
> create a new
> continuation that will resume directly after the point of
> creation. You could
> try something like this:
>
> function redirectAndWait(uri, ttl) {
>   var cont = new FOM_WebContinuation(new Continuation(),
>                  cocoon.continuation, ttl));
>   cocoon.redirectTo(formatUri(uri, cont));
>   FOM_Cocoon.suicide();
> }
>

I don't think I can use this solution, since I need to know the continuation
id beforehand I do the actual redirect (to be used in step 2: "put the id of
the continuation in a deliveryUrl").



> But I don't know where the 'Continuation()' comes from. Before I
> switched to
> my new flow engine I used to create a WebContinuation with
> 'cocoon.createWebContinuation()' and check the request parameters
> to see if
> it's before or after the redirect:
>
> function testingSome(uri) {
>   var c = cocoon.createWebContinuation();
>   print("Continuation = " + c.id);
>   if (cocoon.request.get("afterRedirect") == null) {
>     cocoon.redirectTo(uri);
>   } else {
>     print("Continued executing.");
>   }
> }
>
> This way you have to make sure the user is redirected to the page with
> 'afterRedirect' set (to 'true' for example). I think this way is less
> elegant, because the excution of the flow continuous after the redirect.

This probably works, I'll look into it.

Regards,
  Ulf Sahlin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message