Skip to content

Commit

Permalink
Merge pull request #789 from Amsterdam/fix/spiff-updated
Browse files Browse the repository at this point in the history
dep: spiff update to 1.1.0 (not latest)
  • Loading branch information
mguikema authored May 3, 2022
2 parents d1c6ecb + 25f8d08 commit 8b72064
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions app/apps/workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.shortcuts import get_object_or_404
from django.utils import timezone
from django.utils.dateparse import parse_duration
from SpiffWorkflow.bpmn.BpmnScriptEngine import BpmnScriptEngine
from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine
from SpiffWorkflow.bpmn.serializer.BpmnSerializer import BpmnSerializer
from SpiffWorkflow.bpmn.specs.BoundaryEvent import _BoundaryEventParent
from SpiffWorkflow.bpmn.specs.event_definitions import (
Expand Down Expand Up @@ -204,7 +204,7 @@ def start_subworkflow(subworkflow_name, data={}):
def parse_duration_string(str_duration):
return parse_duration(str_duration)

wf.script_engine = BpmnScriptEngine(
wf.script_engine = PythonScriptEngine(
scriptingAdditions={
"set_status": set_status,
"wait_for_workflows_and_send_message": wait_for_workflows_and_send_message,
Expand Down Expand Up @@ -552,7 +552,8 @@ def get_or_restore_workflow_state(self):
self.serialized_workflow_state, workflow_spec=workflow_spec
)
wf = self.get_script_engine(wf)
except Exception:
except Exception as e:
logger.error(f"deserialize workflow failed: {e}")
return False
return wf
else:
Expand Down
10 changes: 5 additions & 5 deletions app/apps/workflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from deepdiff import DeepDiff
from django.conf import settings
from prettyprinter import pprint
from SpiffWorkflow.bpmn.BpmnScriptEngine import BpmnScriptEngine
from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine
from SpiffWorkflow.bpmn.serializer.BpmnSerializer import BpmnSerializer
from SpiffWorkflow.bpmn.specs.BoundaryEvent import BoundaryEvent
from SpiffWorkflow.bpmn.specs.event_definitions import TimerEventDefinition
Expand Down Expand Up @@ -531,7 +531,7 @@ def ff_workflow(
timer_event_task_start_times={},
message_name=None,
):
script_engine = BpmnScriptEngine(
script_engine = PythonScriptEngine(
scriptingAdditions={
"set_status": lambda *args: None,
"wait_for_workflows_and_send_message": lambda *args: None,
Expand Down Expand Up @@ -627,7 +627,7 @@ def start_workflow(wf=None):


def ff_to_subworkflow(subworkflow, spec, message_name, data):
script_engine = BpmnScriptEngine(
script_engine = PythonScriptEngine(
scriptingAdditions={
"set_status": lambda *args: None,
"wait_for_workflows_and_send_message": lambda *args: None,
Expand Down Expand Up @@ -704,7 +704,7 @@ def set_status(status):
def wait_for_workflows_and_send_message(message):
logger.info(f"wait_for_workflows_and_send_message: {message}")

script_engine = BpmnScriptEngine(
script_engine = PythonScriptEngine(
scriptingAdditions={
"set_status": set_status,
"wait_for_workflows_and_send_message": wait_for_workflows_and_send_message,
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def start_subworkflow(subflow, data={}):
def parse_duration_string(duration_str):
pass

script_engine = BpmnScriptEngine(
script_engine = PythonScriptEngine(
scriptingAdditions={
"set_status": set_status,
"wait_for_workflows_and_send_message": wait_for_workflows_and_send_message,
Expand Down
2 changes: 1 addition & 1 deletion app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ djangorestframework==3.12.4
djangorestframework-simplejwt==4.8.0
drf-spectacular==0.17.2
drf-writable-nested==0.6.3
spiffworkflow @ git+https://github.com/mguikema/spiffworkflow.git
spiffworkflow==1.1.0
Faker==8.13.2
freezegun==1.1.0
deepdiff
Expand Down

0 comments on commit 8b72064

Please sign in to comment.