Class ExecutionService.ExecutionContext

java.lang.Object
ai.nervemind.app.service.ExecutionService.ExecutionContext
Enclosing class:
ExecutionService

public static class ExecutionService.ExecutionContext extends Object
Execution context holds state during workflow execution.
  • Constructor Details

    • ExecutionContext

      public ExecutionContext(Long executionId, ai.nervemind.common.dto.WorkflowDTO workflow, Map<String,Object> input, CredentialService credentialService, ExecutionLogger executionLogger, AtomicBoolean cancelFlag)
      Creates a new execution context.
      Parameters:
      executionId - the execution ID
      workflow - the workflow DTO
      input - the input data
      credentialService - the credential service
      executionLogger - the execution logger
      cancelFlag - the cancel flag
    • ExecutionContext

      public ExecutionContext(Long executionId, ai.nervemind.common.dto.WorkflowDTO workflow, Map<String,Object> input, CredentialService credentialService, ExecutionLogger executionLogger)
      Constructor without cancel flag (for testing/backwards compatibility).
      Parameters:
      executionId - the execution ID
      workflow - the workflow DTO
      input - the input data
      credentialService - the credential service
      executionLogger - the execution logger
  • Method Details

    • getExecutionId

      public Long getExecutionId()
      Gets the execution ID.
      Returns:
      the execution ID
    • getWorkflow

      public ai.nervemind.common.dto.WorkflowDTO getWorkflow()
      Gets the workflow.
      Returns:
      the workflow DTO
    • getInput

      public Map<String,Object> getInput()
      Gets the input data.
      Returns:
      the input data map
    • isCancelled

      public boolean isCancelled()
      Check if this execution has been cancelled.
      Returns:
      true if cancelled
    • getDecryptedCredential

      public String getDecryptedCredential(Long credentialId)
      Gets decrypted credential data.
      Parameters:
      credentialId - the credential ID
      Returns:
      the decrypted credential data
    • getDecryptedCredentialByName

      public String getDecryptedCredentialByName(String name)
      Gets decrypted credential data by name.
      Parameters:
      name - the credential name
      Returns:
      the decrypted credential data or null if not found
    • getExecutionLogger

      public ExecutionLogger getExecutionLogger()
      Gets the execution logger.
      Returns:
      the execution logger
    • recordNodeExecution

      public void recordNodeExecution(String nodeId, ai.nervemind.common.enums.ExecutionStatus status, Instant startTime, Map<String,Object> output, String error)
      Records a node execution.
      Parameters:
      nodeId - the node ID
      status - the execution status
      startTime - the start time
      output - the output data
      error - the error message
    • getNodeExecutions

      public List<Map<String,Object>> getNodeExecutions()
      Gets the recorded node executions.
      Returns:
      list of node execution records