Skip to content

Commit

Permalink
Merge pull request #431 from sartography/enhancement/misc-cleanup
Browse files Browse the repository at this point in the history
Enhancement/misc cleanup
  • Loading branch information
essweine authored Nov 27, 2024
2 parents af2f8ca + 5d09227 commit 4ae938c
Show file tree
Hide file tree
Showing 44 changed files with 47 additions and 1,737 deletions.
320 changes: 0 additions & 320 deletions SpiffWorkflow/bpmn/script_engine/feel_engine.py

This file was deleted.

15 changes: 6 additions & 9 deletions SpiffWorkflow/bpmn/script_engine/python_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import ast
import sys
import traceback
import warnings

from SpiffWorkflow.exceptions import SpiffWorkflowException
from SpiffWorkflow.bpmn.exceptions import WorkflowTaskException
Expand Down Expand Up @@ -65,15 +64,13 @@ def execute(self, task, script, external_context=None):
wte = self.create_task_exec_exception(task, script, err)
raise wte

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

def create_task_exec_exception(self, task, script, err):
line_number, error_line = self.get_error_line_number_and_content(script, err)
Expand Down
4 changes: 2 additions & 2 deletions SpiffWorkflow/bpmn/script_engine/python_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def evaluate(self, expression, context, external_context=None):
def execute(self, script, context, external_context=None):
raise NotImplementedError("Subclass must implement this method")

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


class TaskDataEnvironment(BasePythonScriptEngineEnvironment):
Expand Down
Loading

0 comments on commit 4ae938c

Please sign in to comment.