Don't attempt to gather the augmented methods if no task is provided -- if we aren't working within the context of a task, we are not working in a context where augmented methods can work (at least not all of them). This was causing an error when attepting to use the custom engine to execute extraction expressions on messages.

This commit is contained in:
Dan 2023-03-01 13:46:20 -05:00
parent 27f3da2458
commit be482ea6bc
2 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,12 @@ groups:
admin@spiffworkflow.org, admin@spiffworkflow.org,
nelson@spiffworkflow.org nelson@spiffworkflow.org
] ]
approvers:
users:
[
malala@spiffworkflow.org,
oskar@spiffworkflow.org
]
permissions: permissions:
# Admins have access to everything. # Admins have access to everything.

View File

@ -350,7 +350,9 @@ class CustomBpmnScriptEngine(PythonScriptEngine): # type: ignore
external_methods: Optional[Dict[str, Any]] = None, external_methods: Optional[Dict[str, Any]] = None,
) -> Any: ) -> Any:
"""_evaluate.""" """_evaluate."""
methods = self.__get_augment_methods(task) methods = {}
if task:
methods = self.__get_augment_methods(task)
if external_methods: if external_methods:
methods.update(external_methods) methods.update(external_methods)