mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-12 18:44:14 +00:00
Revert "more finally for better len"
This reverts commit feb25c286d590d90a9dac9a9ba71ec28bf1fa380.
This commit is contained in:
parent
feb25c286d
commit
52b496d105
@ -125,7 +125,6 @@ def process_instance_run(
|
|||||||
raise e
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
ErrorHandlingService().handle_error(processor, e)
|
ErrorHandlingService().handle_error(processor, e)
|
||||||
# fixme: this is going to point someone to the wrong task - it's misinformation for errors in sub-processes
|
|
||||||
task = processor.bpmn_process_instance.last_task
|
task = processor.bpmn_process_instance.last_task
|
||||||
raise ApiError.from_task(
|
raise ApiError.from_task(
|
||||||
error_code="unknown_exception",
|
error_code="unknown_exception",
|
||||||
|
@ -208,21 +208,20 @@ class NonTaskDataBasedScriptEngineEnvironment(BasePythonScriptEngineEnvironment)
|
|||||||
self.state.update(self.globals)
|
self.state.update(self.globals)
|
||||||
self.state.update(external_methods or {})
|
self.state.update(external_methods or {})
|
||||||
self.state.update(context)
|
self.state.update(context)
|
||||||
try:
|
exec(script, self.state) # noqa
|
||||||
exec(script, self.state) # noqa
|
|
||||||
finally:
|
|
||||||
# since the task data is not directly mutated when the script executes, need to determine which keys
|
|
||||||
# have been deleted from the environment and remove them from task data if present.
|
|
||||||
context_keys_to_drop = context.keys() - self.state.keys()
|
|
||||||
|
|
||||||
for key_to_drop in context_keys_to_drop:
|
# since the task data is not directly mutated when the script executes, need to determine which keys
|
||||||
context.pop(key_to_drop)
|
# have been deleted from the environment and remove them from task data if present.
|
||||||
|
context_keys_to_drop = context.keys() - self.state.keys()
|
||||||
|
|
||||||
self.state = self._user_defined_state(external_methods)
|
for key_to_drop in context_keys_to_drop:
|
||||||
|
context.pop(key_to_drop)
|
||||||
|
|
||||||
# the task data needs to be updated with the current state so data references can be resolved properly.
|
self.state = self._user_defined_state(external_methods)
|
||||||
# the state will be removed later once the task is completed.
|
|
||||||
context.update(self.state)
|
# the task data needs to be updated with the current state so data references can be resolved properly.
|
||||||
|
# the state will be removed later once the task is completed.
|
||||||
|
context.update(self.state)
|
||||||
|
|
||||||
def _user_defined_state(
|
def _user_defined_state(
|
||||||
self, external_methods: Optional[Dict[str, Any]] = None
|
self, external_methods: Optional[Dict[str, Any]] = None
|
||||||
|
@ -113,7 +113,7 @@ class ServiceTaskDelegate:
|
|||||||
message = ServiceTaskDelegate.get_message_for_status(
|
message = ServiceTaskDelegate.get_message_for_status(
|
||||||
proxied_response.status_code
|
proxied_response.status_code
|
||||||
)
|
)
|
||||||
error = f"Received an unexpected response from service {name} : {message}"
|
error = f"Received an unexpected response from the service : {message}"
|
||||||
if "error" in parsed_response:
|
if "error" in parsed_response:
|
||||||
error += parsed_response["error"]
|
error += parsed_response["error"]
|
||||||
if json_parse_error:
|
if json_parse_error:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user