[Erp5-dev] Activity semaphoring/locking mechanisms, was: activate_kw for activities - how to use?

Łukasz Nowak lukasz.nowak at ventis.com.pl
Tue Mar 11 11:39:33 CET 2008


Hello,

On 2008-03-03, 11:10:04
Łukasz Nowak <lukasz.nowak at ventis.com.pl> wrote:

> Hello,
> 
> I've seen activate_kw in many places in scripts. I think I *feel* how
> to use it, but I haven't find any documentation about it on
> http://www.erp5.org/HowToUseTheCmfActivityTool nor
> http://www.erp5.org/TechnicalNotesOnActivities nor
> http://svn.erp5.org/erp5/trunk/products/CMFActivity/ActiveObject.py?view=markup
> 
> As activities are quite critical - and I'm just user, not developer of
> them, I think it would be great to ready any notes about activity_kw
> feature.

Some guessing - putting activity-like statements in activate_kw *might*
be supported by scripts and methods invoked in activities, which shall
pass those parameters into activate method call.

Eg, calling:

object.activate().edit(activate_kw={'tag':'my_tag'})
object.activate(after_tag='my_tag').doSomethingElse()

will do:
 - invoke edit with with activities
 - edit will invoke all its subsequents methods with activities and tag
set to 'my_tag'
 - invoking doSomethingElse will wait as long, as all scripts/methods
generated by edit with this tag will be finished

Am I right? Is that what activate_kw is for?

But...it do not resolves my problem.

I've got Sale Packing Lists builder, which is merging many Sale Orders
to one (or more) Sale Packing Lists. It is invoked with SQLDict instead
of SQLQueue, as there might be many Sale Orders confirmed in same time,
and only one builder is enough.

But this builder shall wait as long as there is no calls on paths like:

portal.sale_order_module.getPath()
portal.sale_packing_list_module.getPath()
portal.portal_simulation.getPath() (to be more specific - which
relates to any sale order or sale packing list...)

I tried to use paths with or without % suffix (eg.
python string '/erp5/sale_order_module%%'), but I've figured out that
SQLDict_validateMessageList.zsql[1] is not using like comparison, but
exact one.

Shall I create some kind of semaphore? Is there any nice guide/solution
which I haven't found? Any tips welcome.

Regards,
Luke

[1]http://svn.erp5.org/erp5/trunk/products/CMFActivity/skins/activity/SQLDict_validateMessageList.zsql?view=markup
-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.



More information about the Erp5-dev mailing list