Interface ScriptExecutionStrategy

All Known Implementing Classes:
EmbeddedPythonExecutionStrategy, ExternalPythonExecutionStrategy, JavaScriptExecutionStrategy

public interface ScriptExecutionStrategy
Strategy interface for script execution.

Implementations provide different ways to execute scripts:

See Also:
  • Method Details

    • execute

      Map<String,Object> execute(String code, Map<String,Object> input, ai.nervemind.common.domain.Node node, ExecutionService.ExecutionContext context) throws ScriptExecutionException
      Execute a script with the given input data.
      Parameters:
      code - the script code to execute
      input - input data from previous nodes
      node - the node being executed (for accessing parameters)
      context - the execution context
      Returns:
      output data including script results merged with input
      Throws:
      ScriptExecutionException - if execution fails
    • getLanguageId

      String getLanguageId()
      Get the language identifier this strategy handles.
      Returns:
      the language ID (e.g., "javascript", "python")
    • getDisplayName

      String getDisplayName()
      Get a human-readable name for display.
      Returns:
      display name (e.g., "JavaScript (GraalJS)", "Python (GraalPy)")
    • isAvailable

      default boolean isAvailable()
      Check if this strategy is available (dependencies installed, etc.).
      Returns:
      true if the strategy can be used
    • getAvailabilityInfo

      default String getAvailabilityInfo()
      Get information about why this strategy might not be available.
      Returns:
      diagnostic message, or empty string if available