[Erp5-dev] Activity run-time environment

Pelletier Vincent vincent at nexedi.com
Tue Feb 19 17:36:08 CET 2008


Hi.

I just implemented Activity run-time environment.

It can be used to implement, for example, generic activity tag propagation:
 - Activity 1 is created with a given tag
 - Activity 1 triggers activity 2, and wat it to run when no activity with the
   same tag as 1 is runing

Would be possible like this:

# Generate Actvity 1
context.activate(tag='foo').someMethodOrScript()

# someMethodOrScript
environment = context.getActivityRuntimeEnvironment()
activiy_kw = environment.get('activity_kw', {})
my_tag = activity_kw.get('tag')
context.activate(after_tag=my_tag).someOtherMethodOrScript()

Please note that it is a new feature, and as such it's probably not tested 
enough.
Also, there may be more interesting data that Activity queues should put in 
that environment. Feel free to suggest some, and/or send patches.

-- 
Vincent Pelletier



More information about the Erp5-dev mailing list