One general note (as this is not the first request regarding workflows 
to my personal email):

Regarding questions about the workflow components (or others), allways 
write to the eZ Components list. That way you ensure that other people 
can profit or answer as well. I will allways post to the list as well 
when answering such mails (unless you convince me, why it's better to 
keep it private).


Hi Jesse,

> Hi Thomas, I am sorry to bother you today but I am really interested
> in using the ezWorkflow component in a project I am working on but I
> am having trouble grasping how to incorporate it into the MVC
> architecture. Let's say for instance I have created CRUD screens for
> content entry. Lets also say that I have some semblance of a user
> acl. Now one workflow I have modeled involves a writer creating a
> story and then submitting it to an editor for review before the
> editor publishes the story. I know we can model this with a petri-net
> or a directed graph very easily. I also assume this can be created
> within the ezWorkflow component. My question is how do I get this to
> actually influence the Controllers and Views of the model as it gets
> written then approved then published.

In general you allways need to take care about the execution ids and 
which user it belongs to. It could be stored in the session or database 
or provided via a parameter within the request.

Sometimes it could be stored within the relevant data of the covered 
objects. But if you have a more complex situation, I suggest to use a 
separate table. Such a table could basically contain a column for user 
(group), execution id and perhaps some additional information if needed 
(e.g. action).

When a user sends an article for publishing, you insert an entry in the 
table for the next user (group), the execution id and perhaps the 
additional information. (What the next user group is, could be defined 
in a special execution variable and read generally from the workflow 
execution object.).

When the editor looks into his account, you could query the table and 
present him a list with all pending workflows that needs his 
interaction. He could select one execution and provide the needed input 
data to trigger the workflow to the next step. (If the workflow is not 
finished, you could create a new entry in the table.)

It could be pretty handy if you create your own application-specific 
WorkflowUtils class providing easy handling of starting/triggering 
workflows or fetching a list of all workflows that need input from a 
special user. Then you can reuse this functionality in several places 
of your application.

Hope this answered your question. If not: just ask...

Have a nice day

Thomas



> Thanks in advance. Your help is greatly appreciated!
>
> Jesse Sanford


-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to