Discussion:
[Erp5-dev] Activity run-time environment
Pelletier Vincent
2008-02-19 16:36:08 UTC
Permalink
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
Pelletier Vincent
2008-02-19 16:37:02 UTC
Permalink
Post by Pelletier Vincent
I just implemented Activity run-time environment.
...in revision 19405 .
--
Vincent Pelletier
Loading...