Class DefaultFeatureExecutor
- All Implemented Interfaces:
FeatureLocalExecutor
This ports the core TS WorkflowExecutor semantics into Java: deterministic sequential
orchestration, step retries/backoff, conditional/loop/parallel composition, checkpoint/resume
bookkeeping, signal-aware pause/cancel hooks, and saga-style rollback/compensation summaries.
Domain-specific side effects (database, graph, broker, storage, vector, quota, fallback,
healthcheck, action) are pluggable through registerHandler(java.lang.String, app.ductape.sdk.features.executor.DefaultFeatureExecutor.StepHandler). If no handler is registered
for a domain step, the executor returns a TS-shaped no-op output that includes the step input and
kind; this keeps pure orchestration tests deterministic while allowing applications to wire real
services without processor round-trips.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(FeatureExecutionContext context) Run the feature definition end-to-end.registerHandler(String kind, DefaultFeatureExecutor.StepHandler handler) Register or replace a domain handler by step kind wire value, e.g.replay(FeatureExecutionContext context, String fromStep) TSreplayfrom a specific step (or default = from start).resume(FeatureExecutionContext context, Object fromCheckpoint, String fromStep) TSresumefrom a checkpoint (or step).booleansupports(FeatureExecutionContext context) Optional probe used byFeatureServiceto skip local execution when the executor cannot run a particular feature (e.g.
-
Constructor Details
-
DefaultFeatureExecutor
public DefaultFeatureExecutor()
-
-
Method Details
-
registerHandler
public DefaultFeatureExecutor registerHandler(String kind, DefaultFeatureExecutor.StepHandler handler) Register or replace a domain handler by step kind wire value, e.g.database. -
execute
Description copied from interface:FeatureLocalExecutorRun the feature definition end-to-end. The implementation is responsible for step orchestration, retries, and per-step rollback semantics that the TSWorkflowExecutorprovides.Return shape SHOULD include keys:
status,feature_id,output,error,execution_time,completed_steps,step_timings,failed_step,rollback_info(mirroring TSIWorkflowExecutionResult).FeatureServicenormalizes the result into the public TS-shaped envelope (success/status/data/feature_id/error) before returning to callers.- Specified by:
executein interfaceFeatureLocalExecutor
-
replay
Description copied from interface:FeatureLocalExecutorTSreplayfrom a specific step (or default = from start). Defaults toFeatureLocalExecutor.execute(app.ductape.sdk.features.FeatureExecutionContext)so simple executors stay parity-shaped without extra work.- Specified by:
replayin interfaceFeatureLocalExecutor
-
resume
public Map<String,Object> resume(FeatureExecutionContext context, Object fromCheckpoint, String fromStep) Description copied from interface:FeatureLocalExecutorTSresumefrom a checkpoint (or step). Defaults toFeatureLocalExecutor.execute(app.ductape.sdk.features.FeatureExecutionContext)so simple executors stay parity-shaped without extra work.- Specified by:
resumein interfaceFeatureLocalExecutor
-
supports
Description copied from interface:FeatureLocalExecutorOptional probe used byFeatureServiceto skip local execution when the executor cannot run a particular feature (e.g. uses unsupported step types). Defaults totrue.- Specified by:
supportsin interfaceFeatureLocalExecutor
-