diff --git a/product/ERP5/InteractionWorkflow.py b/product/ERP5/InteractionWorkflow.py index b4887b8d1bf886b7de46455de1859b50c1045cd0..7350e2fd352f0f713b0b72ffacfd82736b304c89 100644 --- a/product/ERP5/InteractionWorkflow.py +++ b/product/ERP5/InteractionWorkflow.py @@ -311,15 +311,15 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject): for script_name in tdef.activate_script_name: self.activate(activity='SQLQueue')\ .activeScript(script_name, ob.getRelativeUrl(), - status, tdef.id, kw) + status, tdef.id) security.declarePrivate('activeScript') - def activeScript(self, script_name, ob_url, status, tdef_id, kwargs=None): + def activeScript(self, script_name, ob_url, status, tdef_id): script = self.scripts[script_name] ob = self.unrestrictedTraverse(ob_url) tdef = self.interactions.get(tdef_id) sci = StateChangeInfo( - ob, self, status, tdef, None, None, kwargs) + ob, self, status, tdef, None, None, None) script(sci) def _getWorkflowStateOf(self, ob, id_only=0): diff --git a/product/ERP5/tests/testInteractionWorkflow.py b/product/ERP5/tests/testInteractionWorkflow.py index d9707895d5ba8986a153b5c591e33aa796717449..367b272951d179b0ce1afbf942c44f2b2cb3bf8d 100644 --- a/product/ERP5/tests/testInteractionWorkflow.py +++ b/product/ERP5/tests/testInteractionWorkflow.py @@ -527,6 +527,33 @@ context.setDescription('%s,%s,%s' % (d, args, result)) get_transaction().commit() self.assertEquals(organisation.getDescription(), "toto,('description',),bad") + def test_17_activity_interaction(self, quiet=0, run=run_all_test): + if not run: return + if not quiet: + self.logMessage('Later Script (In activity)') + self.createInteractionWorkflow() + self.interaction.setProperties( + 'editObject', + once_per_transaction=1, + method_id='_setGroup.*', + activate_script_name=('afterEdit',)) + params = 'sci, **kw' + body = """\ +context = sci['object'] +context.setTitle('Bar') +""" + self.script.ZPythonScript_edit(params, body) + self.createData() + organisation = self.organisation + organisation.setTitle('Foo') + organisation.setGroupValue(organisation) + self.assertEquals(organisation.getTitle(), 'Foo') + get_transaction().commit() + self.assertEquals(organisation.getTitle(), 'Foo') + self.tic() + self.assertEquals(organisation.getTitle(), 'Bar') + + def test_regular_expression(self): # test that we can add an interaction by defining methods using regular # expression