summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-executor/plugins-executor-jython
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-executor/plugins-executor-jython')
-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
3 files changed, 16 insertions, 12 deletions
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);
}