Class CibSevenScriptEngineUtil
java.lang.Object
org.cibseven.bpm.engine.impl.scripting.util.CibSevenScriptEngineUtil
Utility class for creating script engines with CibSeven namespace support.
This class provides helper methods for users who want to create their own
script engines with the CibSevenClassLoader without having compile-time
dependencies on specific script engine implementations.
- Author:
- CibSeven Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptEngineManagerCreates a custom ScriptEngineManager that uses CibSevenClassLoader for script engines.static ScriptEngineCreates a Groovy script engine with CibSevenClassLoader support.static ScriptEnginecreateGroovyScriptEngine(ClassLoader parentClassLoader) Creates a Groovy script engine with CibSevenClassLoader support using a specific parent ClassLoader.static ClassLoaderGets the CibSevenClassLoader that can be used with any script engine.static ClassLoadergetCibSevenClassLoader(ClassLoader parentClassLoader) Gets the CibSevenClassLoader with a specific parent ClassLoader.
-
Constructor Details
-
CibSevenScriptEngineUtil
public CibSevenScriptEngineUtil()
-
-
Method Details
-
createGroovyScriptEngine
Creates a Groovy script engine with CibSevenClassLoader support. This method uses reflection to avoid compile-time dependencies on Groovy. Usage example:ScriptEngine groovyEngine = CibSevenScriptEngineUtil.createGroovyScriptEngine(); if (groovyEngine != null) { // Use the script engine groovyEngine.eval("println 'Hello from CibSeven!'"); }- Returns:
- A Groovy ScriptEngine with CibSevenClassLoader, or null if Groovy is not available
-
createGroovyScriptEngine
Creates a Groovy script engine with CibSevenClassLoader support using a specific parent ClassLoader.- Parameters:
parentClassLoader- The parent ClassLoader to use- Returns:
- A Groovy ScriptEngine with CibSevenClassLoader, or null if Groovy is not available
-
createCibSevenScriptEngineManager
Creates a custom ScriptEngineManager that uses CibSevenClassLoader for script engines. This can be used to get any script engine with CibSeven namespace support.- Returns:
- A ScriptEngineManager with CibSeven support
-
getCibSevenClassLoader
Gets the CibSevenClassLoader that can be used with any script engine. This classloader automatically translates Camunda namespace classes to CibSeven namespace. Usage example with any script engine:ClassLoader cibSevenClassLoader = CibSevenScriptEngineUtil.getCibSevenClassLoader(); // Use with any script engine that accepts a ClassLoader
- Returns:
- A ClassLoader that handles CibSeven namespace translation
-
getCibSevenClassLoader
Gets the CibSevenClassLoader with a specific parent ClassLoader.- Parameters:
parentClassLoader- The parent ClassLoader- Returns:
- A ClassLoader that handles CibSeven namespace translation
-