[Zope-PTK] CMF Dogbowl: workflow Proposal

Kent Polk kent@goathill.org
20 Mar 2001 17:21:19 GMT


On 19 Mar 2001 20:35:00 -0600, Shane Hathaway wrote:
>
>> >So, if the default workflow doesn't quite fit, the intention is that you
>> >replace or subclass DefaultWorkflow.  That doesn't mean you need to
>> >change CMFCore, but until the WorkflowTool is folderish, it does mean
>> >you need to make your own WorkflowTool.
>> 
>> I'm working on it. :^)
>
>I'm glad to hear you're getting into it.  

Few Questions...

I've mapped
DefaultWorkflow.py        WorkflowCore.py        WorkflowTool.py
into
RequestWorkflow.py RequestWorkflowCore.py RequestWorkflowTool.py
and added RequestWorkflowTool.WorkflowTool to __init__ tools

I changed the id's in RequestWorkflow.py & RequestWorkflowTool.py
and the meta_type in RequestWorkflowTool.

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.

I changed the getToolByName() calls in RequestWorkflowCore.py to
match the id in RequestWorkflowTool.py

However, it appears that I'm missing something. When I attempt to
create the new request object, I get:

 Error Value: 'None' object has no attribute 'notifyCreated'

 File /var/zope/Products/CMFDefault/RequestItem.py, line 113, in
   addRequestItem
 File /var/zope/Products/CMFCore/RequestWorkflowCore.py, line 142, in
   afterCreate (Object: DynamicType)

RequestWorkflowCore.py :
def afterCreate(ob):
    wf = getToolByName(ob, 'portal_requestworkflow', None)
    if ob is not None:
        wf.notifyCreated(ob)
        ^^^^^^^^^^^^^^^^^^^^
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?

Thanks