[Zope3-dev] Workflow-Question

Ulrich Eck ueck@net-labs.de
19 May 2003 13:28:23 +0200


Hi Marcus,

it seems that you send out an ObjectCreatedEvent (that's the one, 
the ContentWorkflowsUtility is subscribed to) with the container
as context. the CWU checks if the event's context is
IProcessInstanceContainerAdaptable otherwise it does nothing.

you need to send the ObjectCreatedEvent in context of you newly
created object not the container it is created in.

hope this helps

Ulrich

Am Sam, 2003-05-17 um 12.02 schrieb Marcus J. Ertl:
> Hi!
> 
> I'm just testing the workflow-component! Works fine for me, but there
> is a small problem:
> 
> If I add a object through the managment interface, it got's a workflow!
> All fine!
> 
> But if I use this code:
> 
>         msg = LNMessage(subject=subjects[randint(0,4)]+' (%s)' %
> mimes[type],
>                         mime=mimes[type],
>                         body=bodies[type])
>         msg.name = names[randint(0,4)]
>         msg.email = 'nobody@oz.lcl'
>         
>         publish(target, ObjectCreatedEvent(msg))
>         publish(target, LNMessageAddedEvent(msg))
>         target.setObject(str(id), msg)
> 
> the workflow tab keeps empty! :-(
> 
> What have I to do, make it work? Perhabs to register my object in some
> way to the workflow? If yes, how will this be done?
> 
> Bye
>   Marcus