Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/misc cleanup #431

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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