Class WorkflowKustomizer

java.lang.Object
com.scivicslab.pojoactor.workflow.kustomize.WorkflowKustomizer

public class WorkflowKustomizer extends Object
Processes YAML overlays to generate customized workflows.

WorkflowKustomizer implements a Kustomize-like overlay system for POJO-actor workflows. It allows base workflows to be customized for different environments (development, staging, production) without duplicating code.

Key Features:

  • Strategic merge patches using vertexName as the matching key
  • Variable substitution with ${varName} syntax
  • Name prefix/suffix for workflow names
  • Vertex insertion with anchor-based positioning

Usage:

 WorkflowKustomizer kustomizer = new WorkflowKustomizer();
 Map<String, Object> result = kustomizer.build(Path.of("overlays/production"));
 String yaml = kustomizer.buildAsYaml(Path.of("overlays/production"));
 
Since:
2.9.0
Author:
devteam@scivics-lab.com
  • Constructor Details

    • WorkflowKustomizer

      public WorkflowKustomizer()
      Constructs a new WorkflowKustomizer.
  • Method Details

    • build

      public Map<String,Map<String,Object>> build(Path overlayDir) throws IOException
      Builds the customized workflows from the specified directory.
      Parameters:
      overlayDir - directory containing overlay-conf.yaml
      Returns:
      map of workflow file names to their merged content
      Throws:
      IOException - if files cannot be read
    • buildAsYaml

      public String buildAsYaml(Path overlayDir) throws IOException
      Builds the customized workflows and returns them as a YAML string.
      Parameters:
      overlayDir - directory containing overlay-conf.yaml
      Returns:
      YAML string containing all merged workflows
      Throws:
      IOException - if files cannot be read