Update Basic Workflow

Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
Marc Duiker 2025-03-21 17:51:27 +01:00
parent 4bc32fd929
commit b2f3dbc153
No known key found for this signature in database
GPG Key ID: 6A36EA7754473DD7
5 changed files with 17 additions and 3 deletions

View File

@ -19,4 +19,4 @@ Before you start, it's recommended to read though the Dapr docs to get familiar
- [External Events](./external-system-interaction/README.md)
- [Child Workflows](./child-workflows/README.md)
- [WorkflowManagement](./workflow-management/README.md)
- [Challenges & Tips](./ChallengesTips/README.md)
- [Challenges & Tips](./challenges-tips/README.md)

View File

@ -7,8 +7,20 @@ using Basic.Activities;
namespace Basic;
/// <summary>
/// Workflows inherit from the abstract Workflow class from the Dapr.Workflow namespace.
/// The first generic parameter is the input type of the workflow, and the second parameter is the output type.
/// </summary>
public class BasicWorkflow : Workflow<string, string>
{
/// <summary>
/// The RunAsync method is an abstract method in the abstract Workflow class that needs to be implemented.
/// This method is the entry point for the workflow.
/// </summary>
/// <param name="context">The WorkflowContext provides properties about the workflow instance.
/// It also contains methods to call activities, child workflows, wait for external events, start timers, and continue as a new instance.</param>
/// <param name="input">The input parameter for the workflow. There can only be one input parameter. Use a record or class if multiple input values are required.</param>
/// <returns>The return value of the workflow. It can be a simple or complex type. In case a workflow doesn't require an output, you can specify a nullable object since a return type is mandatory.</returns>
public override async Task<string> RunAsync(WorkflowContext context, string input)
{
var result1 = await context.CallActivityAsync<string>(

View File

@ -1,5 +1,7 @@
# Workflow Basics
This tutorial covers the fundamentals of authoring Dapr Workflows. For more information about the fundamentals of Dapr Workflows, see the [Dapr docs](https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-features-concepts/).
## Run the tutorial
1. Use a terminal to navigate to the `tutorials/workflow/csharp/fundamentals` folder.

View File

@ -2,7 +2,7 @@ version: 1
common:
resourcesPath: ../../resources
apps:
- appID: fanoutfanin
- appID: basic
appDirPath: .
appPort: 5254
daprHTTPPort: 3554

View File

@ -1,6 +1,6 @@
@apphost=http://localhost:5254
### Start the TaskChaining workflow
### Start the Basic workflow
# @name startWorkflowRequest
@input=One
POST {{ apphost }}/start/{{ input }}