From 3be9e1c3242c1ca130145f36ca3a1d7e8ac4cc51 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Fri, 26 Jan 2018 16:06:37 +0900 Subject: [PATCH] CMFActivity: Make "flush" support ActivityRuntimeEnvironment. This is a very minimal support, as "flush" is kind of deprecated, only surviving because tests need to be able to tell which activity may execute, and there is currently no other way to support this. --- product/CMFActivity/Activity/SQLBase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product/CMFActivity/Activity/SQLBase.py b/product/CMFActivity/Activity/SQLBase.py index 5bda50b5ec..1b279d4124 100644 --- a/product/CMFActivity/Activity/SQLBase.py +++ b/product/CMFActivity/Activity/SQLBase.py @@ -677,7 +677,8 @@ class SQLBase(Queue): message.validate(self, activity_tool) if validate_value == VALID: # Try to invoke the message - what happens if invoke calls flushActivity ?? - activity_tool.invoke(message) + with ActivityRuntimeEnvironment(message): + activity_tool.invoke(message) if message.getExecutionState() != MESSAGE_EXECUTED: raise ActivityFlushError('Could not invoke %s on %s' % (message.method_id, path)) -- 2.30.9