Azure / Azure/durabletask

OrchestrationState’s Output property should be equal to the value of the "return;" statement in the TaskOrchestration when using ContinueAsNew.

Open
#366 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
2d 23h
Merged PRs (30d)
6

Description

I do not know whether it is a bug or "by design" but I would expect the OrchestrationState’s Output property to **"always"** be equal to the value of the **"return count;"** statement, even when using ContinueAsNew.

Here are the current behaviors (refer to the code snippet below from Service Fabric FunctionalTest.cs for context):

1. When we are **"not"** using ContinueAsNew, the Output property in the OrchestrationState is **"always equal"** to the value returned by the **“return count;”** statement.

2. When we are using ContinueAsNew, the Output property in the OrchestrationState is **"equal"** to the value of the input of the ContinueAsNew method, until the **"last execution"** at which point the Output property in the OrchestrationState is **"equal"** to the value returned by the **“return count;”** statement.

My expectation is the Output property in the OrchestrationState **"should always be equal"** to the value returned by the **“return count;”** statement.

Can you clarify whether it is a bug or if I am misunderstanding the use of the Output property in OrchestrationState when using ContinueAsNew?

```
public class GenerationBasicOrchestration : TaskOrchestration
{
public static int Result;

public override async Task RunTask(OrchestrationContext context, int numberOfGenerations)
{
var testTasks = context.CreateClient();
int count = await testTasks.IncrementGenerationCount();
numberOfGenerations--;
if (numberOfGenerations > 0)
{
// This OrchestrationState.Ouput property is set to numberOfGeneration
// when context.ContinueAsNew(numberOfGenerations) is being triggered
context.ContinueAsNew(numberOfGenerations);
}

Result = count;
// This OrchestrationState.Ouput property is set to count only when it is the last executions
// i.e. context.ContinueAsNew(numberOfGenerations) has not been triggered
return count;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.