Class ExecuteCodeAction
java.lang.Object
com.kingsrook.qqq.backend.core.actions.scripts.ExecuteCodeAction
Action to execute user/runtime defined code.
This action is designed to support code in multiple languages, by using
executors, e.g., provided by additional runtime qqq dependencies. Initially
we are building qqq-language-support-javascript.
We also have a Java executor, to provide at least a little bit of testability
within qqq-backend-core. This executor is a candidate to be replaced in the
future with something that would do actual dynamic java (whether that's compiled
at runtime, or loaded from a plugin jar at runtime). In other words, the java
executor in place today is just meant to be a placeholder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addApiUtilityToContext
(Map<String, Serializable> context, ScriptRevision scriptRevision) Try to (dynamically) load the ApiScriptUtils object from the api middleware module -- in case the runtime doesn't have that module deployed (e.g, not in the project pom).static void
addApiUtilityToContext
(Map<String, Serializable> context, String apiName, String apiVersion) Try to (dynamically) load the ApiScriptUtils object from the api middleware module -- in case the runtime doesn't have that module deployed (e.g, not in the project pom).void
run
(ExecuteCodeInput input, ExecuteCodeOutput output) static ExecuteCodeInput
setupExecuteCodeInput
(AbstractRunScriptInput<?> input, ScriptRevision scriptRevision) static ExecuteCodeInput
setupExecuteCodeInput
(AbstractRunScriptInput<?> input, ScriptRevision scriptRevision, String fileName)
-
Constructor Details
-
ExecuteCodeAction
public ExecuteCodeAction()
-
-
Method Details
-
run
- Throws:
QException
QCodeException
-
setupExecuteCodeInput
public static ExecuteCodeInput setupExecuteCodeInput(AbstractRunScriptInput<?> input, ScriptRevision scriptRevision) throws QException - Throws:
QException
-
setupExecuteCodeInput
public static ExecuteCodeInput setupExecuteCodeInput(AbstractRunScriptInput<?> input, ScriptRevision scriptRevision, String fileName) throws QException - Throws:
QException
-
addApiUtilityToContext
public static void addApiUtilityToContext(Map<String, Serializable> context, ScriptRevision scriptRevision) Try to (dynamically) load the ApiScriptUtils object from the api middleware module -- in case the runtime doesn't have that module deployed (e.g, not in the project pom). -
addApiUtilityToContext
public static void addApiUtilityToContext(Map<String, Serializable> context, String apiName, String apiVersion) Try to (dynamically) load the ApiScriptUtils object from the api middleware module -- in case the runtime doesn't have that module deployed (e.g, not in the project pom).
-