Class CamundaScriptEngineManager
java.lang.Object
javax.script.ScriptEngineManager
org.cibseven.bpm.engine.impl.scripting.engine.CamundaScriptEngineManager
Custom Script Engine Manager that can execute custom logic:
a) after the discovery of the engines on the classpath; the respective engine factories are created b) before the engines are created. If custom logic is needed for a specific engine after the classpath detection, before the engine creation, it can be added to the classes map.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidstatic ClassLoaderCreates a CibSevenClassLoader that can be used by external script engines.static ClassLoadercreateCibSevenClassLoader(ClassLoader parent) Creates a CibSevenClassLoader with a specific parent ClassLoader.protected ScriptEngineCreates a GraalJS script engine with CibSevenClassLoader using reflection to avoid compile-time dependency.protected ScriptEngineCreates a Groovy script engine with CibSevenClassLoader using reflection to avoid compile-time dependency.protected voidprotected voidexecuteConfigurationBeforeEngineCreation(String engineName) Fetches the config logic of a given engine from the mappings and executes it in case it exists.getEngineByName(String shortName) Methods inherited from class javax.script.ScriptEngineManager
get, getBindings, getEngineByExtension, getEngineByMimeType, getEngineFactories, put, registerEngineExtension, registerEngineMimeType, registerEngineName, setBindings
-
Field Details
-
engineNameToInitLogicMappings
-
-
Constructor Details
-
CamundaScriptEngineManager
public CamundaScriptEngineManager() -
CamundaScriptEngineManager
-
-
Method Details
-
applyConfigOnEnginesAfterClasspathDiscovery
protected void applyConfigOnEnginesAfterClasspathDiscovery() -
getEngineNamesFoundInClasspath
-
getEngineByName
- Overrides:
getEngineByNamein classScriptEngineManager
-
createCibSevenClassLoader
Creates a CibSevenClassLoader that can be used by external script engines. This classloader automatically translates Camunda namespace classes to CibSeven namespace. Example usage with Groovy:ClassLoader cibSevenClassLoader = CamundaScriptEngineManager.createCibSevenClassLoader(); GroovyClassLoader groovyClassLoader = new GroovyClassLoader(cibSevenClassLoader); ScriptEngine groovyEngine = new GroovyScriptEngineImpl(groovyClassLoader);
- Returns:
- A ClassLoader that handles CibSeven namespace translation
-
createCibSevenClassLoader
Creates a CibSevenClassLoader with a specific parent ClassLoader.- Parameters:
parent- The parent ClassLoader- Returns:
- A ClassLoader that handles CibSeven namespace translation
-
executeConfigurationBeforeEngineCreation
Fetches the config logic of a given engine from the mappings and executes it in case it exists.- Parameters:
engineName- the given engine name
-
disableGraalVMInterpreterOnlyModeWarnings
protected void disableGraalVMInterpreterOnlyModeWarnings() -
createGraalJSScriptEngineWithCibSevenClassLoader
protected ScriptEngine createGraalJSScriptEngineWithCibSevenClassLoader(ProcessEngineConfigurationImpl config) Creates a GraalJS script engine with CibSevenClassLoader using reflection to avoid compile-time dependency. Returns null if GraalJS classes are not available at runtime. -
createGroovyScriptEngineWithCibSevenClassLoader
Creates a Groovy script engine with CibSevenClassLoader using reflection to avoid compile-time dependency. Returns null if Groovy classes are not available at runtime.
-