Skip to content

Commit

Permalink
Sub in Sub IT
Browse files Browse the repository at this point in the history
Signed-off-by: Hongxin Liang <[email protected]>
  • Loading branch information
honnix committed Oct 9, 2023
1 parent 2d1d14e commit 572bd7d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@ public Output run(SdkWorkflowBuilder builder, Input input) {
SdkTypes.nulls(),
SdkTypes.nulls())
.withUpstreamNode(hello));
SdkNode<WelcomeWorkflow.Output> greet =
builder.apply(
"greet",
new SubWorkflow().withUpstreamNode(world),
WelcomeWorkflow.Input.create(SdkBindingDataFactory.of("greet")));
@Var SdkBindingData<Long> prev = SdkBindingDataFactory.of(0);
@Var SdkBindingData<Long> value = SdkBindingDataFactory.of(1);
for (int i = 2; i <= input.n().get(); i++) {
SdkBindingData<Long> next =
builder
.apply(
"fib-" + i, new SumTask().withUpstreamNode(world), SumInput.create(value, prev))
"fib-" + i, new SumTask().withUpstreamNode(greet), SumInput.create(value, prev))
.getOutputs();
prev = value;
value = next;
Expand Down

0 comments on commit 572bd7d

Please sign in to comment.