Class ExecutionService.ExecutionContext
java.lang.Object
ai.nervemind.app.service.ExecutionService.ExecutionContext
- Enclosing class:
ExecutionService
Execution context holds state during workflow execution.
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionContext(Long executionId, ai.nervemind.common.dto.WorkflowDTO workflow, Map<String, Object> input, CredentialService credentialService, ExecutionLogger executionLogger) Constructor without cancel flag (for testing/backwards compatibility).ExecutionContext(Long executionId, ai.nervemind.common.dto.WorkflowDTO workflow, Map<String, Object> input, CredentialService credentialService, ExecutionLogger executionLogger, AtomicBoolean cancelFlag) Creates a new execution context. -
Method Summary
Modifier and TypeMethodDescriptiongetDecryptedCredential(Long credentialId) Gets decrypted credential data.Gets decrypted credential data by name.Gets the execution ID.Gets the execution logger.getInput()Gets the input data.Gets the recorded node executions.ai.nervemind.common.dto.WorkflowDTOGets the workflow.booleanCheck if this execution has been cancelled.voidrecordNodeExecution(String nodeId, ai.nervemind.common.enums.ExecutionStatus status, Instant startTime, Map<String, Object> output, String error) Records a node 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 IDworkflow- the workflow DTOinput- the input datacredentialService- the credential serviceexecutionLogger- the execution loggercancelFlag- 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 IDworkflow- the workflow DTOinput- the input datacredentialService- the credential serviceexecutionLogger- the execution logger
-
-
Method Details
-
getExecutionId
-
getWorkflow
public ai.nervemind.common.dto.WorkflowDTO getWorkflow()Gets the workflow.- Returns:
- the workflow DTO
-
getInput
-
isCancelled
public boolean isCancelled()Check if this execution has been cancelled.- Returns:
- true if cancelled
-
getDecryptedCredential
-
getDecryptedCredentialByName
-
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 IDstatus- the execution statusstartTime- the start timeoutput- the output dataerror- the error message
-
getNodeExecutions
-