handle method

  1. @override
FutureOr<Output> handle(
  1. Input data,
  2. ChainContext context
)
override

Handles the input data and produces output

Override this to provide custom step logic. The context can be used to share data between steps. Throws if processing fails.

Implementation

@override
FutureOr<Output> handle(Input data, ChainContext context) async {
  if (!shouldExecute(data, context)) {
    context.addMetadata('step_skipped', runtimeType.toString());
    return getSkipValue(data);
  }

  return executeStep(data, context);
}