From 433c1e4b77a11dc2f92311136e4957a7e174d3df Mon Sep 17 00:00:00 2001 From: Lyncoln Date: Fri, 30 Oct 2026 17:26:08 -0400 Subject: [PATCH] Updated response policy to use registered op and redo the request where indicated --- core/runtime/responsepolicy.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/core/runtime/responsepolicy.py b/core/runtime/responsepolicy.py index df333ff..d2ee06a 100644 --- a/core/runtime/responsepolicy.py +++ b/core/runtime/responsepolicy.py @@ -1,9 +1,15 @@ import logging from core.apirequest import executeRequest +from core.execution import processregistry def responsePolicy(response, action, outputs, resolved): if hasattr(action, "responsepolicy"): + #if processregistry.registeredOp: + #currentOp = processregistry.registeredOp + #print(registeredOp[action.name]["response"]) + #print(currentOp) + if not response.ok: logging.warning(f"{response} during {action.name}") @@ -11,11 +17,19 @@ def responsePolicy(response, action, outputs, resolved): if policy["statuscode"] == response.status_code: logging.warning(policy["print"]) - newresponse = executeRequest(policy["execute"], outputs, resolved) + from core.execution.executioncontract import executeContract + executeContract(policy["execute"]) + + #newresponse = executeRequest(action, outputs, resolved) if policy["response_update"]: logging.info("Updating response") - print("Updating response") + newresponse = executeRequest(action, outputs, resolved) + + #response = newresponse + if processregistry.registeredOp: + response = processregistry.registeredOp[action.name]["response"] + else: response = newresponse break