You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dev at weitling <de...@weitling.net> on 2007/03/06 13:11:58 UTC

Misusing Flowscript & Continuations

Hi,

I want to model a kind of finite state machine elegantly via a
Flowscript. My problem: The whole process is not done in one session but
could last over multiple logins over days or weeks.
To be more precise: I have an object several users will touch one by
one, each changing the state of the object. Depending on the input the
state could be reset or just changed.

Because the process flow is rather easy I would like to use the also
easy continuation concept, but more independent from concrete pipelines
or those nasty short timeouts.

Any idea how to "misuse" FlowScript is appreciated :-)
Florian

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


Re: Misusing Flowscript & Continuations

Posted by Dev at weitling <de...@weitling.net>.
> You might be better served with a workflow engine, see
> http://wiki.apache.org/cocoon/Workflow for example.

Looks great. I start digging thru! (Solving a problem by lavishing with
solutions ;-)

Thanks,
Florian

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


Re: Misusing Flowscript & Continuations

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 3/6/07, Dev at weitling <de...@weitling.net> wrote:

> ...My idea was to model that process as flow handling the state as
> continuation entries saved in the database. When a user has a question
> on his to-do-list the database-loaded continuation just continues in the
> flow....

You might be better served with a workflow engine, see
http://wiki.apache.org/cocoon/Workflow for example.

-Bertrand

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


Cocoon Crossdomain.xml

Posted by Yves Vindevogel <yv...@implements.be>.
Hi,

I'm trying to make a connection from a Flex component to a Cocoon site.
Flash/Flex however prevents access to other domains unless there's a
crossdomain.xml defined.

I placed that file under both my Cocoon root as my subproject folder.
I added it to the sitemap so that crossdomain.xml is a valid path.
However, I still have no data coming in my component.

Anyone who knows how to set up Flash / Cocoon ?

Regards
Yves Vindevogel



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


Re: Misusing Flowscript & Continuations

Posted by Torsten Curdt <tc...@apache.org>.
On 06.03.2007, at 16:46, Tobia wrote:

> Dev at weitling wrote:
>> My idea was to model that process as flow handling the state as
>> continuation entries saved in the database.
>
> I don't think it's a good idea to save (serialized) continuation  
> objects
> in a database.  What happens when you restart Cocoon?  What happens  
> when
> you upgrade Cocoon / Rhino / whatever?

Depends ...javaflow you can serialize.

cheers
--
Torsten



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


Re: Misusing Flowscript & Continuations

Posted by Dev at weitling <de...@weitling.net>.
> I don't think it's a good idea to save (serialized) continuation objects
> in a database.  What happens when you restart Cocoon?  What happens when
> you upgrade Cocoon / Rhino / whatever?
>   

Those questions have been gnawing on me, too. I'm in search of an easy
way to model a state machine as easy as in flowscript. Will have a look
at Bertrand's links.

Till next question :-)
Florian

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


Re: Misusing Flowscript & Continuations

Posted by Tobia <to...@linux.it>.
Dev at weitling wrote:
> My idea was to model that process as flow handling the state as
> continuation entries saved in the database.

I don't think it's a good idea to save (serialized) continuation objects
in a database.  What happens when you restart Cocoon?  What happens when
you upgrade Cocoon / Rhino / whatever?


Tobia

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


Re: Misusing Flowscript & Continuations

Posted by Dev at weitling <de...@weitling.net>.
Hi Tobia,

> I don't know if this can be considered "misuse" of flowscript.
>   

We are at a misunderstanding now...
It's not about email. It's about an object (here a question for an
examination) going through a process of creation, editing, rating,
translating by several users (authors, experts, bigbosses, translators)
over days or weeks. I consider the process as flow (or a finite state
machine) where the object goes from state to state by actions of the users.
My idea was to model that process as flow handling the state as
continuation entries saved in the database. When a user has a question
on his to-do-list the database-loaded continuation just continues in the
flow.

Hope this explanation didn't make it worse...

Florian



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


Re: Misusing Flowscript & Continuations

Posted by Torsten Curdt <tc...@apache.org>.
On 06.03.2007, at 18:32, Tobia wrote:

> Torsten Curdt wrote:
>> That's a misuse of continuations. Why the steps?
>> That's what the continuation will do for you.
>> Think outside of the state machine
>>
>>  showPasswordForm();
>>  sendEmail();
>>  // now the email will have the link to the continuation
>>  showSentPage();
>>  // execution will suspend here
>>  showNewPasswordForm();
>>  updateDatabase();
>>  showPasswordUpdatedPage();
>
> How can I put the continuation id in the email text, but have the
> continuation resume several blocks after, where you put 'execution
> will suspend here'?

Cannot remember from the top of my head ...but you should be able to  
get access to the currently running continuation.
You send out the mail with that id/link and then just suspend.

cheers
--
Torsten



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


Re: Misusing Flowscript & Continuations

Posted by Tobia <to...@linux.it>.
Torsten Curdt wrote:
> That's a misuse of continuations. Why the steps?
> That's what the continuation will do for you.
> Think outside of the state machine
> 
>  showPasswordForm();
>  sendEmail();
>  // now the email will have the link to the continuation
>  showSentPage();
>  // execution will suspend here
>  showNewPasswordForm();
>  updateDatabase();
>  showPasswordUpdatedPage();

How can I put the continuation id in the email text, but have the
continuation resume several blocks after, where you put 'execution
will suspend here'?


Tobia

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


Re: Misusing Flowscript & Continuations

Posted by Torsten Curdt <tc...@apache.org>.
On 06.03.2007, at 14:58, Tobia wrote:

> Dev at weitling wrote:
>> Any idea how to "misuse" FlowScript is appreciated :-)
>
> I don't know if this can be considered "misuse" of flowscript.
> It's an email confirmation thingy made as a trivial state machine.
> The interesting part is the interaction of the step variable with
> the continuation.  Here it is in "pseudo-flowscript":


That's a misuse of continuations. Why the steps?
That's what the continuation will do for you.
Think outside of the state machine

  showPasswordForm();
  sendEmail();
  // now the email will have the link to the continuation
  showSentPage();
  // execution will suspend here
  showNewPasswordForm();
  updateDatabase();
  showPasswordUpdatedPage();

...that is the beauty of continuations in the web world

cheers
--
Torsten

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


Re: Misusing Flowscript & Continuations

Posted by Tobia <to...@linux.it>.
Dev at weitling wrote:
> Any idea how to "misuse" FlowScript is appreciated :-)

I don't know if this can be considered "misuse" of flowscript.
It's an email confirmation thingy made as a trivial state machine.
The interesting part is the interaction of the step variable with 
the continuation.  Here it is in "pseudo-flowscript":


function forgotten_password() {

  // showForm() to ask the user for his email address

  // DB query to look up the email address among the registered users

  // if (it's not there) sendPage() to tell the user to sod off

  var step = 1
  var cont = cocoon.createWebContinuation()

  if (step == 1) {

    step = 2

    // send an email to the user, containing a link to cont.id, telling
    // him to click on the link if he wishes to change his password

    // sendPage() to tell the user that an email has been sent

  } else if (step == 2) {

    // showForm() to ask for a new password, twice

    // update the database with the new password

    // sendPage() to tell the user that the password has been updated

  }
}


Tobia

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


Re: Misusing Flowscript & Continuations

Posted by Torsten Curdt <tc...@apache.org>.
On 04.04.2007, at 11:12, Warrell wrote:

> I wonder if you have looked at the SCXML Apache project
> http://jakarta.apache.org/commons/scxml/. This offers a very robust
> implementation of a an FSM specified in XML.

*shiver*

> I'm thinking you could
> implement your persistent FSM in this and then query it from Cocoon.

Or just fix up Cocoon to make use of the serialization support of  
javaflow :)

cheers
--
Torsten



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


RE: Misusing Flowscript & Continuations

Posted by Warrell <wa...@iquo.co.uk>.
I wonder if you have looked at the SCXML Apache project
http://jakarta.apache.org/commons/scxml/. This offers a very robust
implementation of a an FSM specified in XML. I'm thinking you could
implement your persistent FSM in this and then query it from Cocoon.

I might look into it myself although I recognise that continuations and Flow
eliminate the need for an FSM at the web navigation level,

Warrell

-----Original Message-----
From: Dev at weitling [mailto:dev@weitling.net] 
Sent: 06 March 2007 12:12
To: Users at Cocoon
Subject: Misusing Flowscript & Continuations

Hi,

I want to model a kind of finite state machine elegantly via a Flowscript.
My problem: The whole process is not done in one session but could last over
multiple logins over days or weeks.
To be more precise: I have an object several users will touch one by one,
each changing the state of the object. Depending on the input the state
could be reset or just changed.

Because the process flow is rather easy I would like to use the also easy
continuation concept, but more independent from concrete pipelines or those
nasty short timeouts.

Any idea how to "misuse" FlowScript is appreciated :-) Florian

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



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