Skip to content

Commit

Permalink
modify readme (#1192)
Browse files Browse the repository at this point in the history
Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
  • Loading branch information
MregXN and halspang authored Nov 29, 2023
1 parent e435efd commit abcbf4f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/Workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ Dapr workflow, as well as this example program, now support authentication throu
## Projects in sample

This sample contains a single [WorkflowConsoleApp](./WorkflowConsoleApp) .NET project.
It utilizes the workflow SDK as well as the workflow management API for starting and querying workflows instances.
The main `Program.cs` file contains the main setup of the app, including the registration of the workflow and workflow activities.
The workflow definition is found in the `Workflows` directory and the workflow activity definitions are found in the `Activities` directory.
It utilizes the workflow SDK as well as the workflow management API for simulating inventory management and sale of goods in a store.
The main `Program.cs` file contains the main setup of the app, the registration of the workflow and its activities, and interaction with the user. The workflow definition is found in the `Workflows` directory and the workflow activity definitions are found in the `Activities` directory.

There are five activities in the directory that could be called by the workflows:
- `NotifyActivity`: printing logs as notifications
- `ProcessPaymentActivity`: printing logs and delaying for simulating payment processing
- `RequestApprovalActivity`: printing logs to indicate that the order has been approved
- `ReserveInventoryActivity`: checking if there are enough items for purchase
- `UpdateInventoryActivity`: updating the statestore according to purchasing

The `OrderProcessingWorkflow.cs` in `Workflows` directory implements the running logic of the workflow. Based on the purchase stage and outcome, it calls different activities and waits for the corresponding events to trigger interaction with the user.

This sample also contains a [WorkflowUnitTest](./WorkflowUnitTest) .NET project that utilizes [xUnit](https://xunit.net/) and [Moq](https://github.com/moq/moq) to test the workflow logic.
It works by creating an instance of the `OrderProcessingWorkflow` (defined in the `WorkflowConsoleApp` project), mocking activity calls, and testing the inputs and outputs.
Expand Down

0 comments on commit abcbf4f

Please sign in to comment.