|
From: Marco B. <m.b...@ic...> - 2007-02-01 16:57:45
|
Dennis Schulz ha scritto:
> Hello Marco and Openflow Team,
>
> Maybe its the best when I try to explain what I want to do exactly.
> I would like to model a purchase request approval process with openflow.
>
> All logged in persons (Role Authenticated?
> <http://localhost:8080/ttt/process/account/ed/manage_roleForm?role_to_manage=Authenticated>)
> can create a purchase request (fill out a form)
> When submitted, a process instance should be created.
>
> The next approver (budget holder) is not static and has to be looked up
> in a relational data base.
> How to to this? Is it good to create a local role for this purpose?
>
No.
You define a push application, which receives your instance_id,
workitem_id, and openflow_id
You should know who created the instance (let's say you wrote it on a
property on the instance, which you can call the author).
You define an automatic application, which can even be a method of a
product. So, you have something like:
class MyPushApplications(SimpleItem):
def findBudgetHolder(self, instance_id, workitem_id, openflow_id):
workflow = getattr(self, openflow_id)
instance = workflow.getInstance(instance_id)
author = instance.getProperty('author')
budget_holder = self.findBudgetHolderFor(author)
return budget_holder
> Then the next approver (division head) has to be looked up in the data
> base as well.
>
You can do the same (another method in MyPushApplication class)
> When approved, it finally goes to the administration that can print out
> the order.
>
Administration is a single user or a group of users?
> (Administration is a fixed group of users, so I add a fixed local role?)
>
> It is not too complicated, but I just dont know where to start.
> I looked at the examples on the openflow website (account.zexp, leave.zexp).
>
> Maybe you have a similar process that you could share ?
>
Not exactly... and, moreover, we can show you the processes (PAFlow has
a lot of processes inside) but I think there would be too much
information, for you.
> The interesting things for me are how to call the api functions of
> openflow from a zope filesystem product.
>
Basically, the first thing you've to do is to get access to the openflow
instance. Then, you can call the workfow APIs on it (but more on this
later ;))
> (I have the forms basically ready as zope filesystem page templates and
> want to build it together with openflow now)
>
>
> A question regarding the addInstance:
> What is the customer field for? The docu says that it is created from
> customer id and creation time. but it also works like this:
> i_id = l_wf.addInstance(l_process_id, '', '', '', 0)
>
> The instance is uniquely identified only by the returned i_id in the
> future?
> So I have to save this ID with my workflowed object or how else can I
> identify it?
>
>
The customer field derived from WMFC... I think it is dead code by now.
> Kind Regards and Thank you very much for your help, Dennis
>
>
Regards
Marco
|