[Zope-PTK] CMF Dogbowl: workflow Proposal
Kent Polk
kent@goathill.org
Tue, 20 Mar 2001 14:05:08 -0600 (CST)
Shane Hathaway wrote:
> Kent Polk wrote:
> >
>
> I suggest you do not rename portal_workflow. Its name is part of its
> interface.
>
> The only thing you need in RequestWorkflowTool.py is something like
> this:
>
> class RequestWorkflowTool(WorkflowTool):
> default_workflow = RequestWorkflow()
I had done this. I haven't actually changed the workflow states
yet, so I don't know if it is really working correctly yet.
> Maybe it's time to just make it into a folder, though...
Yes, yes. :^)
> > I added a getRecipientOf() to RequestWorkflow.py which hopefully
> > extracts the recipient values from the request objects, and included
> > 'recipient': self.getRecipientOf(ob) in the getCatalogVariablesFor
> > dictionary.
>
> You can make getRecipientOf() accessible by DTML by making it available
> through getInfoFor(), which searches through the available workflows
> until it finds something that can provide the requested information.
def getRecipientOf(self, ob):
tool = aq_parent(aq_inner(self))
if hasattr(aq_base(ob), 'recipient'):
recipient = ob.recipient
else:
recipient = 'none'
return recipient
with the changes to getInfoFor():
if name == 'recipient':
return self.getRecipientOf(ob)
but dtml still can't locate 'recipient':
Error Type: KeyError
Error Value: recipient
Don't see how 'recipient' isn't getting handled. Seems like it should
at least exist and be 'none'.
> > So it appear that getToolByName() isn't picking up the correct
> > tool. Any ideas on what I missed? Does the rest of the stuff
> > look reasonable?
>
> It sounds reasonable, though I'm not sure why you need a
> RequestWorkflowCore. What's different there?
Well, I couldn't see how the WorkFlowAction knew how to select the
correct workflow for the RequestItem without it, but I see that it
does hook up to it though. :^)
Thanks