summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-executor
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-executor')
-rw-r--r--plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java8
-rw-r--r--plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java8
-rw-r--r--plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java8
-rw-r--r--plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java41
-rw-r--r--plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java16
-rw-r--r--plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelExecutorParameters.java (renamed from plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MVELExecutorParameters.java)4
-rw-r--r--plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java6
-rw-r--r--plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java6
16 files changed, 75 insertions, 70 deletions
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
index 4fff29092..8577d18fb 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
@@ -65,17 +65,17 @@ public class JavaStateFinalizerExecutor 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 executionId the execution ID 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)
+ public String execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the Java logic
boolean returnValue = false;
@@ -84,7 +84,7 @@ public class JavaStateFinalizerExecutor extends StateFinalizerExecutor {
// StateFinalizerExecutionContext executor) throws ApexException"
// to invoke the
// task logic in the Java class
- final Method method = stateFinalizerLogicObject.getClass().getDeclaredMethod("getStateOutput",
+ final Method method = stateFinalizerLogicObject.getClass().getDeclaredMethod("getStateOutput", (Class[])
new Class[] { StateFinalizerExecutionContext.class });
returnValue = (boolean) method.invoke(stateFinalizerLogicObject, getExecutionContext());
} catch (final Exception e) {
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
index 753f08b7e..829434dc3 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
@@ -66,17 +66,17 @@ public class JavaTaskExecutor extends TaskExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the Java logic
boolean returnValue = false;
@@ -84,7 +84,7 @@ public class JavaTaskExecutor extends TaskExecutor {
// Find and call the method with the signature "public boolean getEvent(final TaskExecutionContext executor)
// throws ApexException" to invoke the
// task logic in the Java class
- final Method method = taskLogicObject.getClass().getDeclaredMethod("getEvent",
+ final Method method = taskLogicObject.getClass().getDeclaredMethod("getEvent", (Class[])
new Class[] { TaskExecutionContext.class });
returnValue = (boolean) method.invoke(taskLogicObject, getExecutionContext());
} catch (final Exception e) {
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
index a42ff2cfa..e642972af 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
@@ -66,17 +66,17 @@ public class JavaTaskSelectExecutor extends TaskSelectExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingEvent);
+ executePre(executionId, incomingEvent);
// Check and execute the Java logic
boolean returnValue = false;
@@ -84,7 +84,7 @@ public class JavaTaskSelectExecutor extends TaskSelectExecutor {
// Find and call the method with the signature "public boolean getTask(final TaskSelectionExecutionContext
// executor)" to invoke the task selection
// logic in the Java class
- final Method method = taskSelectionLogicObject.getClass().getDeclaredMethod("getTask",
+ final Method method = taskSelectionLogicObject.getClass().getDeclaredMethod("getTask", (Class[])
new Class[] { TaskSelectionExecutionContext.class });
returnValue = (boolean) method.invoke(taskSelectionLogicObject, getExecutionContext());
} catch (final Exception e) {
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 7b91c5975..bc3062d13 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
@@ -70,17 +70,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 executionId the execution ID 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)
+ public String execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, 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 38be929c0..14e4ba384 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
@@ -69,17 +69,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 executionId the execution ID 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)
+ public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, 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 570b33b2a..adeb73f88 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
@@ -44,6 +44,10 @@ public class JavascriptTaskSelectExecutor extends TaskSelectExecutor {
// Logger for this class
private static final XLogger LOGGER = XLoggerFactory.getXLogger(JavascriptTaskSelectExecutor.class);
+ // Recurring string constants
+ private static final String TSL_FAILED_PREFIX =
+ "execute: task selection logic failed to set a return value for state \"";
+
// Javascript engine
private ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
private CompiledScript compiled = null;
@@ -61,9 +65,9 @@ public class JavascriptTaskSelectExecutor extends TaskSelectExecutor {
compiled = ((Compilable) engine).compile(getSubject().getTaskSelectionLogic().getLogic());
} catch (final ScriptException e) {
LOGGER.error("execute: task selection logic failed to compile for state \"" + getSubject().getKey().getId()
- + "\"");
- throw new StateMachineException(
- "task selection logic failed to compile for state \"" + getSubject().getKey().getId() + "\"", e);
+ + "\"");
+ throw new StateMachineException("task selection logic failed to compile for state \""
+ + getSubject().getKey().getId() + "\"", e);
}
}
@@ -71,17 +75,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 executionId the execution ID 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 EnEvent incomingEvent)
+ throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingEvent);
+ executePre(executionId, incomingEvent);
// Set up the Javascript engine
engine.put("executor", getExecutionContext());
@@ -95,27 +99,24 @@ public class JavascriptTaskSelectExecutor extends TaskSelectExecutor {
compiled.eval(engine.getContext());
}
} catch (final ScriptException e) {
- LOGGER.error(
- "execute: task selection logic failed to run for state \"" + getSubject().getKey().getId() + "\"");
+ LOGGER.error("execute: task selection logic failed to run for state \"" + getSubject().getKey().getId()
+ + "\"");
throw new StateMachineException(
- "task selection logic failed to run for state \"" + getSubject().getKey().getId() + "\"", e);
+ "task selection logic failed to run for state \"" + getSubject().getKey().getId() + "\"",
+ e);
}
try {
final Object ret = engine.get("returnValue");
if (ret == null) {
- LOGGER.error("execute: task selection logic failed to set a return value for state \""
- + getSubject().getKey().getId() + "\"");
- throw new StateMachineException(
- "execute: task selection logic failed to set a return value for state \""
- + getSubject().getKey().getId() + "\"");
+ LOGGER.error(TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\"");
+ throw new StateMachineException(TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\"");
}
returnValue = (Boolean) ret;
} catch (NullPointerException | ClassCastException e) {
LOGGER.error("execute: task selection logic failed to set a correct return value for state \""
- + getSubject().getKey().getId() + "\"", e);
- throw new StateMachineException("execute: task selection logic failed to set a return value for state \""
- + getSubject().getKey().getId() + "\"", e);
+ + getSubject().getKey().getId() + "\"", e);
+ throw new StateMachineException(TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\"", e);
}
// Do the execution post work
@@ -137,8 +138,8 @@ public class JavascriptTaskSelectExecutor extends TaskSelectExecutor {
@Override
public void cleanUp() throws StateMachineException {
LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
- + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
- + getSubject().getTaskSelectionLogic().getLogic());
+ + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
+ + getSubject().getTaskSelectionLogic().getLogic());
engine = null;
}
}
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
index f8f66e5d2..9e9024401 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
@@ -70,17 +70,17 @@ public class JrubyStateFinalizerExecutor 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 executionId the execution ID 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)
+ public String execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the JRuby logic
container.put("executor", getExecutionContext());
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
index 56b28d02e..d49423486 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
@@ -70,17 +70,17 @@ public class JrubyTaskExecutor extends TaskExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the JRuby logic
container.put("executor", getExecutionContext());
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
index 8405f4e60..b3ce7e0fd 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
@@ -71,17 +71,17 @@ public class JrubyTaskSelectExecutor extends TaskSelectExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingEvent);
+ executePre(executionId, incomingEvent);
// Check and execute the JRuby logic
container.put("executor", getExecutionContext());
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java
index ea8f027c5..ecd9f7ae1 100644
--- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java
@@ -75,20 +75,20 @@ public class JythonStateFinalizerExecutor 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 executionId the execution ID 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)
+ public String execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
boolean returnValue = false;
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
try {
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
index e1c0f096a..39ca0dc43 100644
--- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
@@ -77,20 +77,20 @@ public class JythonTaskExecutor extends TaskExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
boolean returnValue = false;
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
try {
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
index 4f4d38a19..3ff061fa4 100644
--- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
@@ -43,6 +43,10 @@ import org.slf4j.ext.XLoggerFactory;
public class JythonTaskSelectExecutor extends TaskSelectExecutor {
private static final XLogger LOGGER = XLoggerFactory.getXLogger(JythonTaskSelectExecutor.class);
+ // Recurring string constants
+ private static final String TSL_FAILED_PREFIX =
+ "execute: task selection logic failed to set a return value for state \"";
+
// The Jython interpreter
private final PythonInterpreter interpreter = new PythonInterpreter();
private PyCode compiled = null;
@@ -77,20 +81,20 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent)
throws StateMachineException, ContextException {
boolean returnValue = false;
// Do execution pre work
- executePre(executionID, incomingEvent);
+ executePre(executionId, incomingEvent);
try {
// Check and execute the Jython logic
@@ -103,10 +107,10 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor {
try {
final Object ret = interpreter.get("returnValue", java.lang.Boolean.class);
if (ret == null) {
- LOGGER.error("execute: task selection logic failed to set a return value for state \""
+ LOGGER.error(TSL_FAILED_PREFIX
+ getSubject().getKey().getId() + "\"");
throw new StateMachineException(
- "execute: task selection logic failed to set a return value for state \""
+ TSL_FAILED_PREFIX
+ getSubject().getKey().getId() + "\"");
}
returnValue = (Boolean) ret;
@@ -114,7 +118,7 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor {
LOGGER.error("execute: task selection logic failed to set a correct return value for state \""
+ getSubject().getKey().getId() + "\"", e);
throw new StateMachineException(
- "execute: task selection logic failed to set a return value for state \""
+ TSL_FAILED_PREFIX
+ getSubject().getKey().getId() + "\"",
e);
}
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MVELExecutorParameters.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelExecutorParameters.java
index 21d124212..7b57ad446 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MVELExecutorParameters.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelExecutorParameters.java
@@ -30,11 +30,11 @@ import org.onap.policy.apex.core.engine.ExecutorParameters;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class MVELExecutorParameters extends ExecutorParameters {
+public class MvelExecutorParameters extends ExecutorParameters {
/**
* Constructor that sets the abstract implementation classes.
*/
- public MVELExecutorParameters() {
+ public MvelExecutorParameters() {
this.setTaskExecutorPluginClass(MvelTaskExecutor.class.getCanonicalName());
this.setTaskSelectionExecutorPluginClass(MvelTaskSelectExecutor.class.getCanonicalName());
this.setStateFinalizerExecutorPluginClass(MvelStateFinalizerExecutor.class.getCanonicalName());
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
index ea39c6d74..5086259a8 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
@@ -68,17 +68,17 @@ public class MvelStateFinalizerExecutor 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 executionId the execution ID 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)
+ public String execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the MVEL logic
argumentNotNull(compiled, "MVEL state finalizer logic not compiled.");
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
index 966a8004a..457539411 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
@@ -68,17 +68,17 @@ public class MvelTaskExecutor extends TaskExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingFields);
+ executePre(executionId, incomingFields);
// Check and execute the MVEL logic
argumentNotNull(compiled, "MVEL task not compiled.");
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
index 4991fbade..b07c5e260 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
@@ -69,17 +69,17 @@ public class MvelTaskSelectExecutor extends TaskSelectExecutor {
/**
* Executes the executor for the task in a sequential manner.
*
- * @param executionID the execution ID for the current APEX policy execution
+ * @param executionId the execution ID 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)
+ public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent)
throws StateMachineException, ContextException {
// Do execution pre work
- executePre(executionID, incomingEvent);
+ executePre(executionId, incomingEvent);
// Check and execute the MVEL logic
argumentNotNull(compiled, "MVEL task not compiled.");