Skip to content

Commit 4ae938c

Browse files
authored
Merge pull request #431 from sartography/enhancement/misc-cleanup
Enhancement/misc cleanup
2 parents af2f8ca + 5d09227 commit 4ae938c

File tree

44 files changed

+47
-1737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+47
-1737
lines changed

SpiffWorkflow/bpmn/script_engine/feel_engine.py

Lines changed: 0 additions & 320 deletions
This file was deleted.

SpiffWorkflow/bpmn/script_engine/python_engine.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import ast
2121
import sys
2222
import traceback
23-
import warnings
2423

2524
from SpiffWorkflow.exceptions import SpiffWorkflowException
2625
from SpiffWorkflow.bpmn.exceptions import WorkflowTaskException
@@ -65,15 +64,13 @@ def execute(self, task, script, external_context=None):
6564
wte = self.create_task_exec_exception(task, script, err)
6665
raise wte
6766

68-
def call_service(self, operation_name, operation_params, task_data):
67+
def call_service(self, task, **kwargs):
6968
"""Override to control how external services are called from service tasks."""
70-
warnings.warn(
71-
'In the next release, implementation of this method will be moved to the scripting environment',
72-
DeprecationWarning,
73-
stacklevel=2,
74-
)
75-
# Ideally, this method would look like call_service(self, task, operation_name, operation_params)
76-
return self.environment.call_service(operation_name, operation_params, task_data)
69+
try:
70+
return self.environment.call_service(task.data, **kwargs)
71+
except Exception as err:
72+
wte = self.create_task_exec_exception(task, script, err)
73+
raise wte
7774

7875
def create_task_exec_exception(self, task, script, err):
7976
line_number, error_line = self.get_error_line_number_and_content(script, err)

SpiffWorkflow/bpmn/script_engine/python_environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def evaluate(self, expression, context, external_context=None):
3030
def execute(self, script, context, external_context=None):
3131
raise NotImplementedError("Subclass must implement this method")
3232

33-
def call_service(self, operation_name, operation_params, task_data):
34-
raise NotImplementedError("To call external services override the script engine and implement `call_service`.")
33+
def call_service(self, context, **kwargs):
34+
raise NotImplementedError("Subclass must implement this method.")
3535

3636

3737
class TaskDataEnvironment(BasePythonScriptEngineEnvironment):

0 commit comments

Comments
 (0)