diff options
Diffstat (limited to 'plugins/plugins-executor/plugins-executor-javascript/src/main/java')
3 files changed, 24 insertions, 15 deletions
diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java index c906a9ca3..cd660c807 100644 --- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java +++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java @@ -22,6 +22,8 @@ package org.onap.policy.apex.plugins.executor.javascript; import java.util.Map; +import java.util.Properties; + import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.ScriptEngine; @@ -34,8 +36,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class JavascriptStateFinalizerExecutor is the state finalizer executor for state finalizer - * logic written in Javascript It is unlikely that this is thread safe. + * The Class JavascriptStateFinalizerExecutor is the state finalizer executor for state finalizer logic written in + * Javascript It is unlikely that this is thread safe. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -70,16 +72,17 @@ public class JavascriptStateFinalizerExecutor extends StateFinalizerExecutor { * Executes the executor for the state finalizer logic in a sequential manner. * * @param executionId the execution ID for the current APEX policy execution + * @param executionProperties properties for the current APEX policy execution * @param incomingFields the incoming fields for finalisation * @return The state output for the state * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public String execute(final long executionId, final Map<String, Object> incomingFields) - throws StateMachineException, ContextException { + public String execute(final long executionId, final Properties executionProperties, + final Map<String, Object> incomingFields) throws StateMachineException, ContextException { // Do execution pre work - executePre(executionId, incomingFields); + executePre(executionId, executionProperties, incomingFields); // Set up the Javascript engine engine.put("executor", getExecutionContext()); diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java index 4b6ff0232..9769f42db 100644 --- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java +++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java @@ -22,6 +22,8 @@ package org.onap.policy.apex.plugins.executor.javascript; import java.util.Map; +import java.util.Properties; + import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.ScriptEngine; @@ -34,8 +36,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class JavascriptTaskExecutor is the task executor for task logic written in Javascript It is - * unlikely that this is thread safe. + * The Class JavascriptTaskExecutor is the task executor for task logic written in Javascript It is unlikely that this + * is thread safe. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -69,16 +71,17 @@ public class JavascriptTaskExecutor extends TaskExecutor { * Executes the executor for the task in a sequential manner. * * @param executionId the execution ID for the current APEX policy execution + * @param executionProperties properties for the current APEX policy execution * @param incomingFields the incoming fields * @return The outgoing fields * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields) - throws StateMachineException, ContextException { + public Map<String, Object> execute(final long executionId, final Properties executionProperties, + final Map<String, Object> incomingFields) throws StateMachineException, ContextException { // Do execution pre work - executePre(executionId, incomingFields); + executePre(executionId, executionProperties, incomingFields); // Set up the Javascript engine engine.put("executor", getExecutionContext()); diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java index 305f3a2da..afc7d0183 100644 --- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java +++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.plugins.executor.javascript; +import java.util.Properties; + import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.ScriptEngine; @@ -35,8 +37,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class JavascriptTaskSelectExecutor is the task selection executor for task selection logic - * written in Javascript It is unlikely that this is thread safe. + * The Class JavascriptTaskSelectExecutor is the task selection executor for task selection logic written in Javascript + * It is unlikely that this is thread safe. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -76,16 +78,17 @@ public class JavascriptTaskSelectExecutor extends TaskSelectExecutor { * Executes the executor for the task in a sequential manner. * * @param executionId the execution ID for the current APEX policy execution + * @param executionProperties properties for the current APEX policy execution * @param incomingEvent the incoming event * @return The outgoing event * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent) - throws StateMachineException, ContextException { + public AxArtifactKey execute(final long executionId, final Properties executionProperties, + final EnEvent incomingEvent) throws StateMachineException, ContextException { // Do execution pre work - executePre(executionId, incomingEvent); + executePre(executionId, executionProperties, incomingEvent); // Set up the Javascript engine engine.put("executor", getExecutionContext()); |