Class ExecutableScript

java.lang.Object
org.finos.fluxnova.bpm.engine.impl.scripting.ExecutableScript
Direct Known Subclasses:
CompiledExecutableScript, DynamicExecutableScript

public abstract class ExecutableScript extends Object

Represents an executable script.

Author:
Daniel Meyer
  • Field Details

    • language

      protected final String language
      The language of the script. Used to resolve the ScriptEngine.
  • Constructor Details

    • ExecutableScript

      protected ExecutableScript(String language)
  • Method Details

    • getLanguage

      public String getLanguage()
      The language in which the script is written.
      Returns:
      the language
    • execute

      public Object execute(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings)

      Evaluates the script using the provided engine and bindings

      Parameters:
      scriptEngine - the script engine to use for evaluating the script.
      variableScope - the variable scope of the execution
      bindings - the bindings to use for evaluating the script.
      Returns:
      the result of the script evaluation
      Throws:
      ProcessEngineException - in case the script cannot be evaluated.
    • getActivityIdExceptionMessage

      protected String getActivityIdExceptionMessage(VariableScope variableScope)
    • evaluate

      protected abstract Object evaluate(ScriptEngine scriptEngine, VariableScope variableScope, Bindings bindings)
    • preprocessScript

      protected String preprocessScript(String script, VariableScope variableScope)
      Preprocesses a script before execution.

      If script preprocessing is disabled, no preprocessor is configured, or the preprocessor returns null, the original script is returned unchanged.

      If preprocessing fails with an exception, a warning is logged and the original script is returned as a safe fallback to ensure scripts continue to execute.

      Parameters:
      script - the script text to preprocess; may be null
      variableScope - the current execution context; may be null
      Returns:
      the preprocessed script, or the original script if preprocessing is disabled, not configured, returns null, or fails with an exception