diff --git a/SpiffWorkflow/spiff/specs/service_task.py b/SpiffWorkflow/spiff/specs/service_task.py index b1c63a943..80e3f3453 100644 --- a/SpiffWorkflow/spiff/specs/service_task.py +++ b/SpiffWorkflow/spiff/specs/service_task.py @@ -1,3 +1,4 @@ +from copy import deepcopy import json from SpiffWorkflow.bpmn.specs.ServiceTask import ServiceTask from SpiffWorkflow.spiff.specs.spiff_task import SpiffBpmnTask @@ -27,7 +28,8 @@ class ServiceTask(SpiffBpmnTask, ServiceTask): param['value'] = task.workflow.script_engine.evaluate(task, param['value']) return param - evaluated_params = {k: evaluate(v) for k, v in self.operation_params.items()} + operation_params_copy = deepcopy(self.operation_params) + evaluated_params = {k: evaluate(v) for k, v in operation_params_copy.items()} result = task.workflow.script_engine.call_service(self.operation_name, evaluated_params, task.data) diff --git a/tests/SpiffWorkflow/spiff/ServiceTaskTest.py b/tests/SpiffWorkflow/spiff/ServiceTaskTest.py index 9417b42ed..1d3035b3f 100644 --- a/tests/SpiffWorkflow/spiff/ServiceTaskTest.py +++ b/tests/SpiffWorkflow/spiff/ServiceTaskTest.py @@ -60,6 +60,15 @@ class ServiceTaskTest(BaseTestCase): self.workflow.do_engine_steps() self._assert_service_tasks() + def testRunSameServiceTaskActivityMultipleTimes(self): + self.workflow.do_engine_steps() + service_task_activity = [t for t in self.workflow.get_tasks() if + t.task_spec.name == 'Activity-1inxqgx'][0] + + service_task_activity.task_spec._execute(service_task_activity) + service_task_activity.task_spec._execute(service_task_activity) + service_task_activity.task_spec._execute(service_task_activity) + def testRunThroughSaveRestore(self): self.save_restore() # Engine isn't preserved through save/restore, so we have to reset it.