You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Aleksei Valikov <va...@gmx.net> on 2006/07/17 17:51:05 UTC

"Process" scope

Hi.

In web applications, it is often desirable to have a "process" scope of beans. 
Process-scoped beans are retained between sessions, but in contradiction to 
session scope there can be many of them per session. An example of process scope 
scenarion is a document deletion:

select document -> display backup options page -> display deletion confirmation 
page -> congratulate that the document is deleted

During the deletion process you somehow need to keep track of the document that 
is being deleted.
You can't model that with a request-scope bean since this will be lost in a 
multiple-step process.
You also can't model this with session-scope bean since if the user tries to 
delete several documents concurrently, you'll get into trouble.
Therefore you need a "process"-scoped bean. There'll be one instance per 
initiated process, but these instances will not be lost across requests.

Are there any existing approaches to process-scoping that could be used with 
MyFaces?

My idea was tracking processes with an URL parameters and use a custom variable 
resolver (+ Spring maybe) to instantiate beans on a per-process basis.

Bye.
/lexi

Re: "Process" scope

Posted by Cosma Colanicchia <co...@gmail.com>.
Trinidad has a "pageFlowScope". There is also a "conversation"
component, you may want to take a look at it.

Cosma

2006/7/17, Aleksei Valikov <va...@gmx.net>:
> Hi.
>
> In web applications, it is often desirable to have a "process" scope of beans.
> Process-scoped beans are retained between sessions, but in contradiction to
> session scope there can be many of them per session. An example of process scope
> scenarion is a document deletion:
>
> select document -> display backup options page -> display deletion confirmation
> page -> congratulate that the document is deleted
>
> During the deletion process you somehow need to keep track of the document that
> is being deleted.
> You can't model that with a request-scope bean since this will be lost in a
> multiple-step process.
> You also can't model this with session-scope bean since if the user tries to
> delete several documents concurrently, you'll get into trouble.
> Therefore you need a "process"-scoped bean. There'll be one instance per
> initiated process, but these instances will not be lost across requests.
>
> Are there any existing approaches to process-scoping that could be used with
> MyFaces?
>
> My idea was tracking processes with an URL parameters and use a custom variable
> resolver (+ Spring maybe) to instantiate beans on a per-process basis.
>
> Bye.
> /lexi
>

Re: "Process" scope

Posted by David Chandler <tu...@gmail.com>.
Also check out WebFlow Navigation Module (wfnm.sourceforge.net), which
offers JSP tags that demarcate page flows and uses a session listener to
automatically destroy session managed beans associated with a page flow when
you exit that flow.

Ultimately, I'd like to see something more integrated with existing JSF
concepts, perhaps a "flow" scope for managed beans, for example, in addition
to "request" and "session." The approach I'm currently leaning toward is to
add a webflow tag (a la Spring Webflow) to faces-config, in which you could
specify the name of an associated JSF-managed bean. When you exit the flow,
the bean would automatically be destroyed. Just like Spring Webflow, a
webflow as I envision it would consist of multiple views. Each view could
also be associated with a managed bean that would be destroyed upon
transitioning away from the view. This would be the equivalent of a "flash"
such that the bean would only exist for the render phase of one request and
the action phase of the next, which is often exactly what is needed and no
more.

Is this close to what you're looking for?

/dmc
http://turbomanage.blogspot.com/


On 7/17/06, Andrew Robinson <an...@gmail.com> wrote:
>
> Look at JBoss-Seam, it was made for Conversation scope. It even has
> the ability to list all current conversations for the user so that you
> can have multiple active processes per user. So the user could be
> booking a hotel room and renting a car at the same time for example.
>
> -Andrew
>
> On 7/17/06, Matthias Wessendorf <ma...@apache.org> wrote:
> > Look here
> >
> > http://irian.at/myfaces-sandbox/pageConversation.jsf
> >
> > and the source of the page
> > http://irian.at/myfaces-sandbox/pageConversation.jsp.source
> >
> > -Matthoias
> >
> > On 7/17/06, Aleksei Valikov <va...@gmx.net> wrote:
> > > Hi.
> > >
> > > > How about the processScope in the MyFaces sandbox, written by Mario
> > > > Ivankovits?
> > >
> > > Sorry, I've searched the sandbox trunk but could not find anything
> with
> > > "processScope" inside. Could you please maybe post a link?
> > >
> > > Bye.
> > > /lexi
> > >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>

Re: "Process" scope

Posted by Andrew Robinson <an...@gmail.com>.
Look at JBoss-Seam, it was made for Conversation scope. It even has
the ability to list all current conversations for the user so that you
can have multiple active processes per user. So the user could be
booking a hotel room and renting a car at the same time for example.

-Andrew

On 7/17/06, Matthias Wessendorf <ma...@apache.org> wrote:
> Look here
>
> http://irian.at/myfaces-sandbox/pageConversation.jsf
>
> and the source of the page
> http://irian.at/myfaces-sandbox/pageConversation.jsp.source
>
> -Matthoias
>
> On 7/17/06, Aleksei Valikov <va...@gmx.net> wrote:
> > Hi.
> >
> > > How about the processScope in the MyFaces sandbox, written by Mario
> > > Ivankovits?
> >
> > Sorry, I've searched the sandbox trunk but could not find anything with
> > "processScope" inside. Could you please maybe post a link?
> >
> > Bye.
> > /lexi
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: "Process" scope

Posted by Matthias Wessendorf <ma...@apache.org>.
Look here

http://irian.at/myfaces-sandbox/pageConversation.jsf

and the source of the page
http://irian.at/myfaces-sandbox/pageConversation.jsp.source

-Matthoias

On 7/17/06, Aleksei Valikov <va...@gmx.net> wrote:
> Hi.
>
> > How about the processScope in the MyFaces sandbox, written by Mario
> > Ivankovits?
>
> Sorry, I've searched the sandbox trunk but could not find anything with
> "processScope" inside. Could you please maybe post a link?
>
> Bye.
> /lexi
>


-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: "Process" scope

Posted by Aleksei Valikov <va...@gmx.net>.
Hi.

> How about the processScope in the MyFaces sandbox, written by Mario 
> Ivankovits?

Sorry, I've searched the sandbox trunk but could not find anything with 
"processScope" inside. Could you please maybe post a link?

Bye.
/lexi

Re: "Process" scope

Posted by Martin Marinschek <ma...@gmail.com>.
How about the processScope in the MyFaces sandbox, written by Mario Ivankovits?

regards,

Martin

On 7/17/06, Aleksei Valikov <va...@gmx.net> wrote:
> Hi.
>
> > Take a look at the saveState tag. It might do what you need.
>
> My beans are way too heavy to be persisted with saveState.
>
> Bye
> /lexi
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: "Process" scope

Posted by Aleksei Valikov <va...@gmx.net>.
Hi.

> Take a look at the saveState tag. It might do what you need. 

My beans are way too heavy to be persisted with saveState.

Bye
/lexi

RE: "Process" scope

Posted by Julian Ray <ju...@yahoo.com>.
Take a look at the saveState tag. It might do what you need. 

-----Original Message-----
From: Aleksei Valikov [mailto:valikov@gmx.net] 
Sent: Monday, July 17, 2006 11:51 AM
To: MyFaces Discussion
Subject: "Process" scope

Hi.

In web applications, it is often desirable to have a "process" scope of
beans. 
Process-scoped beans are retained between sessions, but in contradiction to
session scope there can be many of them per session. An example of process
scope scenarion is a document deletion:

select document -> display backup options page -> display deletion
confirmation page -> congratulate that the document is deleted

During the deletion process you somehow need to keep track of the document
that is being deleted.
You can't model that with a request-scope bean since this will be lost in a
multiple-step process.
You also can't model this with session-scope bean since if the user tries to
delete several documents concurrently, you'll get into trouble.
Therefore you need a "process"-scoped bean. There'll be one instance per
initiated process, but these instances will not be lost across requests.

Are there any existing approaches to process-scoping that could be used with
MyFaces?

My idea was tracking processes with an URL parameters and use a custom
variable resolver (+ Spring maybe) to instantiate beans on a per-process
basis.

Bye.
/lexi