Package ai.mindconnect.workflow.jackson
Class JacksonWorkflowDefinitionRegistry
java.lang.Object
ai.mindconnect.workflow.jackson.JacksonWorkflowDefinitionRegistry
- All Implemented Interfaces:
WorkflowDefinitionRegistry
A
WorkflowDefinitionRegistry that lazily loads workflow definitions
from JSON files on the classpath.
Workflows are stored under a configurable base directory (default:
/workflows) as <workflowId>.json. Definitions loaded from
the classpath are cached so each file is only parsed once.
Programmatically registered definitions (via putWorkflowDefinition(java.lang.String, ai.mindconnect.workflow.domain.WorkflowData))
take precedence over classpath files.
Example classpath layout:
src/main/resources/
workflows/
my_import_flow.json
my_query_flow.json
Then: registry.getWorkflowDefinition("my_import_flow") loads and
caches /workflows/my_import_flow.json.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a registry that scans the default/workflowsclasspath directory.JacksonWorkflowDefinitionRegistry(JacksonWorkflowSerializer serializer, String baseDir) Creates a registry that scans the given classpath directory. -
Method Summary
Modifier and TypeMethodDescriptiongetWorkflowDefinition(String workflowId) voidputWorkflowDefinition(String id, WorkflowData workflowData)
-
Constructor Details
-
JacksonWorkflowDefinitionRegistry
Creates a registry that scans the default/workflowsclasspath directory. -
JacksonWorkflowDefinitionRegistry
Creates a registry that scans the given classpath directory.- Parameters:
serializer- the serializer used to parse JSON filesbaseDir- classpath-relative directory, e.g./workflows
-
-
Method Details
-
getWorkflowDefinition
- Specified by:
getWorkflowDefinitionin interfaceWorkflowDefinitionRegistry
-
putWorkflowDefinition
- Specified by:
putWorkflowDefinitionin interfaceWorkflowDefinitionRegistry
-