Skip to content

Commit

Permalink
refactor: migrate plugin.core.output to dynamic properties
Browse files Browse the repository at this point in the history
migrate OutputValues task
  • Loading branch information
mgabelle committed Jan 13, 2025
1 parent ac8a05c commit 4de65e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.kestra.core.models.annotations.Example;
import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.models.property.Property;
import io.kestra.core.models.tasks.RunnableTask;
import io.kestra.core.models.tasks.Task;
import io.kestra.core.runners.RunContext;
Expand Down Expand Up @@ -60,13 +61,13 @@ public class OutputValues extends Task implements RunnableTask<OutputValues.Outp
title = "The templated strings to render.",
description = "These values can be strings, numbers, arrays, or objects. Templated strings (enclosed in {{ }}) will be rendered using the current context."
)
private HashMap<String, Object> values;
private Property<Map<String, Object>> values;


@Override
public OutputValues.Output run(RunContext runContext) throws Exception {
return OutputValues.Output.builder()
.values(runContext.render(values))
return Output.builder()
.values(runContext.render(values).asMap(String.class, Object.class))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.junit.jupiter.api.Test;

@KestraTest(startRunner = true)
public class OutputValuesTest {
class OutputValuesTest {
@Inject
FlowRepositoryInterface flowRepository;

Expand Down

0 comments on commit 4de65e7

Please sign in to comment.