From f65457cbfc77ba4b6e72b6697dfd57a2c679dc63 Mon Sep 17 00:00:00 2001 From: t-burch Date: Wed, 25 Oct 2023 15:52:37 +0200 Subject: [PATCH] Added parameters for ConditionalInterceptor --- .../interceptor/flow/ConditionalInterceptor.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/predic8/membrane/core/interceptor/flow/ConditionalInterceptor.java b/core/src/main/java/com/predic8/membrane/core/interceptor/flow/ConditionalInterceptor.java index 834baa7ed2..6dbb52bb83 100644 --- a/core/src/main/java/com/predic8/membrane/core/interceptor/flow/ConditionalInterceptor.java +++ b/core/src/main/java/com/predic8/membrane/core/interceptor/flow/ConditionalInterceptor.java @@ -25,8 +25,10 @@ import java.util.*; import java.util.function.*; +import static com.predic8.membrane.core.interceptor.Interceptor.Flow.REQUEST; import static com.predic8.membrane.core.interceptor.Outcome.*; import static com.predic8.membrane.core.interceptor.flow.ConditionalInterceptor.LanguageType.*; +import static com.predic8.membrane.core.lang.ScriptingUtils.createParameterBindings; /** * @description

@@ -69,8 +71,15 @@ public void init(Router router) throws Exception { } private boolean testCondition(Exchange exc) { - HashMap parameters = new HashMap<>(); - parameters.put("exc", exc); + HashMap parameters = new HashMap<>() {{ + put("Outcome", Outcome.class); + put("RETURN", RETURN); + put("CONTINUE", CONTINUE); + put("ABORT", Outcome.ABORT); + put("spring", router.getBeanFactory()); + put("exc", exc); + }}; + parameters.putAll(createParameterBindings(router.getUriFactory(), exc, exc.getRequest(), REQUEST, false)); return condition.apply(parameters); }