Module agentforge4j.config.loader
Class BaseWorkflowBundleLoader
java.lang.Object
com.agentforge4j.config.loader.workflow.BaseWorkflowBundleLoader
- Direct Known Subclasses:
ClasspathWorkflowLoader,FileSystemWorkflowLoader
Loads workflow definitions from a backing source.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Map<String,AgentDefinition> loadBundledAgentsFromBundle(WorkflowBundleLoadContext context, String workflowId, List<String> bundleFiles) protected abstract <T> TloadItem(WorkflowBundleLoadContext context, String path, String workflowId, String derivedId, String type, Class<T> typeClass) protected abstract StringloadRawContent(WorkflowBundleLoadContext context, String classpathPath, String workflowId) protected WorkflowDirectoryLoadloadWorkflows(WorkflowBundleLoadContext context) loadWorkflows(Path root) protected abstract voidlog(System.Logger.Level level, String message, Object... args) protected WorkflowDefinitionreadWorkflow(WorkflowBundleLoadContext context, String workflowId, Map<String, AgentDefinition> bundledAgents) retrieveFilesFromIndex(WorkflowBundleLoadContext context, String workflowId) protected abstract WorkflowDefinitionretrieveWorkflowDefinition(WorkflowBundleLoadContext context, String workflowId, Map<String, AgentDefinition> bundledAgents) protected final WorkflowDefinitiontoWorkflowDefinition(com.fasterxml.jackson.databind.JsonNode document, String source) Converts a parsed workflow document tree into aWorkflowDefinition, enforcing the wire-format version envelope first.
-
Field Details
-
WORKFLOW_DEFINITION_FILE
- See Also:
-
SCHEMA_VERSION_FIELD
- See Also:
-
WORKFLOW_DIR_SUFFIX
- See Also:
-
BLUEPRINT_SUFFIX
- See Also:
-
ARTIFACT_SUFFIX
- See Also:
-
STEP_PROMPT_SUFFIX
- See Also:
-
AGENTS_DIR
- See Also:
-
-
Constructor Details
-
BaseWorkflowBundleLoader
public BaseWorkflowBundleLoader()
-
-
Method Details
-
log
-
getWorkflowIdList
-
retrieveWorkflowDefinition
protected abstract WorkflowDefinition retrieveWorkflowDefinition(WorkflowBundleLoadContext context, String workflowId, Map<String, AgentDefinition> bundledAgents) -
retrieveFilesFromIndex
protected abstract List<String> retrieveFilesFromIndex(WorkflowBundleLoadContext context, String workflowId) -
loadItem
-
loadRawContent
protected abstract String loadRawContent(WorkflowBundleLoadContext context, String classpathPath, String workflowId) -
loadBundledAgentsFromBundle
protected abstract Map<String,AgentDefinition> loadBundledAgentsFromBundle(WorkflowBundleLoadContext context, String workflowId, List<String> bundleFiles) -
loadWorkflows
-
loadWorkflows
-
readWorkflow
protected WorkflowDefinition readWorkflow(WorkflowBundleLoadContext context, String workflowId, Map<String, AgentDefinition> bundledAgents) -
toWorkflowDefinition
protected final WorkflowDefinition toWorkflowDefinition(com.fasterxml.jackson.databind.JsonNode document, String source) throws com.fasterxml.jackson.core.JsonProcessingException Converts a parsed workflow document tree into aWorkflowDefinition, enforcing the wire-format version envelope first.Every
workflow.jsondocument must declare the requiredschemaVersionfield matchingWorkflowSchemaVersion.SUPPORTED_WORKFLOW_SCHEMA_VERSION; a missing, non-integer, or unsupported version fails closed with an error naming both the declared and the supported version. The field is a wire-envelope concern consumed here — it is stripped before Jackson mapping, so the domain model never carries it and strict mappers never see it as an unknown property.- Parameters:
document- parsed workflow document treesource- human-readable document source (file path or URL) for error messages- Returns:
- the mapped workflow definition
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the document tree cannot be mapped to the model
-