[Yanel-dev] Listener/Observer Pattern

Josias Thöny josias.thoeny at wyona.com
Tue Jun 5 11:54:26 CEST 2007


On Tue, 2007-06-05 at 09:52 +0200, Michael Wechner wrote:
> Hi
> 
> I would like to implement something like that if a document is being 
> saved, then the workflow
> is being updated. 

When it was decided that workflow should be coupled to revisions, I
thought one benefit of this approach was that what you mention is not
necessary. I mean, when you save a document, a new revision is created,
which just gets the initial workflow state. The workflow states of
existing revisions won't be changed.
I guess you are now talking about a situation where there's a workflow,
but no revisions.

> Now this can be a very specific feature (even if it 
> might be common) and hence I don't think we should tightly
> couple it, but rather introduce a Listener/Observer component.
> 
> WDYT?

Maybe you could add a workflow parameter to the "save" request url in
the introspection:
yanel.resource.workflow.transition=sometransition

But the question is how to know when to add this parameter.

If you go the listener/observer way, how would you decide what an
observer is going to do if a resource is being saved?
I mean how would you connect this to the workflow schema?

josias

> 
> 
> Cheers
> 
> Michi
> 




More information about the Yanel-development mailing list