@@ -156,12 +156,12 @@ public <T, R> SELF exportAs(Function<T, R> function, Class<T> taskResultClass) {
156156 /**
157157 * Shapes what the task exports for downstream consumers using a context-aware filter function.
158158 *
159- * <p>This variant provides access to both workflow and task context, allowing you to inspect
160- * metadata when shaping the export.
159+ * <p>This variant provides access to the task result, workflow context, and task context,
160+ * allowing you to inspect metadata when shaping the export.
161161 *
162- * @param <T> the workflow context type
162+ * @param <T> the task result type
163163 * @param <R> the export type (what gets written in the context)
164- * @param function the filter function with workflow and task context
164+ * @param function the filter function with task result, workflow context, and task context
165165 * @return this step for method chaining
166166 * @see io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations#exportAs(FilterFunction)
167167 */
@@ -177,10 +177,10 @@ public <T, R> SELF exportAs(FilterFunction<T, R> function) {
177177 * Shapes what the task exports for downstream consumers using a context-aware filter function
178178 * with explicit input type.
179179 *
180- * @param <T> the workflow context type
180+ * @param <T> the task result type
181181 * @param <R> the export type (what gets written in the context)
182- * @param function the filter function with workflow and task context
183- * @param taskResultClass the class of the workflow context type
182+ * @param function the filter function with task result, workflow context, and task context
183+ * @param taskResultClass the class of the task result type
184184 * @return this step for method chaining
185185 * @see io.serverlessworkflow.fluent.func.spi.FuncTaskTransformations#exportAs(FilterFunction,
186186 * Class)
@@ -278,7 +278,7 @@ public SELF exportAs(String jqExpression) {
278278 *
279279 * <pre>{@code
280280 * agent("investmentAnalyst", analyst::analyse, InvestmentMemo.class)
281- * .outputAs(memo -> Map.of("memo", memo ))
281+ * .outputAs(taskOutput -> Map.of("memo", taskOutput ))
282282 * .when(condition);
283283 * }</pre>
284284 *
@@ -318,20 +318,21 @@ public <T, R> SELF outputAs(Function<T, R> function, Class<T> taskResultClass) {
318318 * Shapes what gets written back into the workflow data document using a context-aware filter
319319 * function.
320320 *
321- * <p>This variant provides access to both workflow and task context, allowing you to inspect
322- * metadata, task input, and raw output when shaping the committed output.
321+ * <p>This variant provides access to the task result as the first lambda parameter, plus the
322+ * workflow and task context for metadata, task input, and raw output when shaping the committed
323+ * output.
323324 *
324325 * <p><strong>Example:</strong>
325326 *
326327 * <pre>{@code
327328 * get("fetchMarketData", "http://localhost:8081/market-data/{ticker}")
328- * .outputAs((MarketDataSnapshot snapshot ,
329+ * .outputAs((MarketDataSnapshot taskOutput ,
329330 * WorkflowContextData wf,
330331 * TaskContextData task) -> {
331332 * var input = task.input().asMap().orElseThrow();
332333 * var rawBody = task.rawOutput().asText().orElseThrow();
333334 * return new InvestmentPrompt(
334- * snapshot .ticker(),
335+ * taskOutput .ticker(),
335336 * input.get("objective").toString(),
336337 * rawBody
337338 * );
@@ -340,7 +341,7 @@ public <T, R> SELF outputAs(Function<T, R> function, Class<T> taskResultClass) {
340341 *
341342 * @param <T> the task result type
342343 * @param <R> the output type (what gets written to workflow data)
343- * @param function the filter function with workflow and task context
344+ * @param function the filter function with task result, workflow context, and task context
344345 * @return this step for method chaining
345346 * @see io.serverlessworkflow.fluent.func.spi.FuncTransformations#outputAs(FilterFunction)
346347 */
@@ -358,7 +359,7 @@ public <T, R> SELF outputAs(FilterFunction<T, R> function) {
358359 *
359360 * @param <T> the task result type
360361 * @param <R> the output type (what gets written to workflow data)
361- * @param function the filter function with workflow and task context
362+ * @param function the filter function with task result, workflow context, and task context
362363 * @param taskResultClass the class of the task result type
363364 * @return this step for method chaining
364365 * @see io.serverlessworkflow.fluent.func.spi.FuncTransformations#outputAs(FilterFunction, Class)
0 commit comments