Interface FeatureLocalExecutor

All Known Implementing Classes:
DefaultFeatureExecutor

public interface FeatureLocalExecutor
Local executor seam for FeatureService.

Mirrors the TS WorkflowExecutor entry surface (~3000 lines in sdk/ts/src/workflows/workflow-executor.ts) without forcing the Java SDK to ship a full step-by-step engine. When a user provides their own implementation via FeatureService.setLocalExecutor(FeatureLocalExecutor), the executeLocal, replayLocal, and resumeLocal entry points delegate to it with a fully resolved FeatureExecutionContext (product, env, feature definition, input, session). Cache, logging, and result normalization remain owned by FeatureService so the wire-shape matches TS.

Default implementations of replay(app.ductape.sdk.features.FeatureExecutionContext, java.lang.String) and resume(app.ductape.sdk.features.FeatureExecutionContext, java.lang.Object, java.lang.String) simply delegate back to execute(app.ductape.sdk.features.FeatureExecutionContext), matching the TS behavior where replay re-runs the feature from the indicated step / checkpoint.

  • Method Details

    • execute

      Run the feature definition end-to-end. The implementation is responsible for step orchestration, retries, and per-step rollback semantics that the TS WorkflowExecutor provides.

      Return shape SHOULD include keys: status, feature_id, output, error, execution_time, completed_steps, step_timings, failed_step, rollback_info (mirroring TS IWorkflowExecutionResult). FeatureService normalizes the result into the public TS-shaped envelope (success/status/ data/feature_id/error) before returning to callers.

    • replay

      default Map<String,Object> replay(FeatureExecutionContext context, String fromStep)
      TS replay from a specific step (or default = from start). Defaults to execute(app.ductape.sdk.features.FeatureExecutionContext) so simple executors stay parity-shaped without extra work.
    • resume

      default Map<String,Object> resume(FeatureExecutionContext context, Object fromCheckpoint, String fromStep)
      TS resume from a checkpoint (or step). Defaults to execute(app.ductape.sdk.features.FeatureExecutionContext) so simple executors stay parity-shaped without extra work.
    • supports

      default boolean supports(FeatureExecutionContext context)
      Optional probe used by FeatureService to skip local execution when the executor cannot run a particular feature (e.g. uses unsupported step types). Defaults to true.