Hey John,

Thanks for the quick reply!

Yeah, I realized later on that I really was trying to store ridiculous
things in the workitem. I was trying to have the workitem carry
tempfiles uploaded into my Rails application from human participants
so that the next (automated) participant could attach the files to the
database records (via a Paperclip attribute) and send an e-mail
notification as to which documents were received and which were still
pending. Open file handles don't serialize very well anyway.  >_<

I'm using OpenWFE::Extras::ArWorkitem, so I was thinking of having the
files attached to the database records in an after_save callback
(dynamically mixed in by activity type) and just setting attributes in
the workitem to indicate which documents were received so that the
process can send an appropriate e-mail notification. I'm slowly
learning what does and doesn't work well when defining processes and
implementing automated participants.

Thanks again,
Enrico


On Aug 19, 10:12 am, John Mettraux <[email protected]> wrote:
> On Wed, Aug 19, 2009 at 11:03 PM, Enrico Bianco<[email protected]> wrote:
>
> > While trying to debug a process, I noticed that the OpenWFE module
> > provides a 'fulldup' method for creating a deep copy of an object. I
> > think there's a problem with the implementation. From line 79 of lib/
> > openwfe/utils.rb:
>
> > o = object.class.new
>
> > This won't work for classes that don't have a 0-argument constructor
> > (or a constructor in which all arguments have a default value). It
> > seems like we should just be cloning the object instead:
>
> > o = object.clone
>
> > But I'm wondering if this could cause problems in other places.
> > Anybody have any further insights here?
>
> Hi Enrico,
>
> yes, there have been troubles in the past, and the current
> implementation of OpenWFE.fulldup is the result of an evolution.
>
> If you look at its implementation, you'll notice that at first it
> tries to call the target's fulldup method if any, then it tries to use
> Marshal (which is quite fast), the it goes on with object.class.new
>
> So usually, object with no zero-args constructors are easily 'cloned'
> via Marshal load(dump). (Note that you can customize how the instances
> of class get dumped/loaded by provided them with a marshal_load /
> marshal_dump method pair)
>
> As a side note, it's not a good idea to try to stuff everything and
> the kitchen sink in a workitem. I tend to place in them a minimal
> amount of information, mostly references (URIs) to other resources in
> the application / enterprise / system.
>
> Hope this help, thanks for using the mailing list and opening the
> discussion, cheers,
>
> --
> John Mettraux   -  http://jmettraux.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to