Skip to content

Commit f83e3dc

Browse files
WhitWaldomsfussell
andauthored
Updated .NET workflow method names (#4586)
* Updated .NET workflow method names Signed-off-by: Whit Waldo <[email protected]> * Fixed incorrect .NET method name for purging workflow instances Signed-off-by: Whit Waldo <[email protected]> --------- Signed-off-by: Whit Waldo <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
1 parent 04c9b58 commit f83e3dc

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,31 +138,29 @@ Manage your workflow within your code. In the `OrderProcessingWorkflow` example
138138

139139
```csharp
140140
string orderId = "exampleOrderId";
141-
string workflowComponent = "dapr";
142-
string workflowName = "OrderProcessingWorkflow";
143141
OrderPayload input = new OrderPayload("Paperclips", 99.95);
144142
Dictionary<string, string> workflowOptions; // This is an optional parameter
145143
146-
// Start the workflow. This returns back a "StartWorkflowResponse" which contains the instance ID for the particular workflow instance.
147-
StartWorkflowResponse startResponse = await daprClient.StartWorkflowAsync(orderId, workflowComponent, workflowName, input, workflowOptions);
144+
// Start the workflow using the orderId as our workflow ID. This returns a string containing the instance ID for the particular workflow instance, whether we provide it ourselves or not.
145+
await daprWorkflowClient.ScheduleNewWorkflowAsync(nameof(OrderProcessingWorkflow), orderId, input, workflowOptions);
148146

149147
// Get information on the workflow. This response contains information such as the status of the workflow, when it started, and more!
150-
GetWorkflowResponse getResponse = await daprClient.GetWorkflowAsync(orderId, workflowComponent, eventName);
148+
WorkflowState currentState = await daprWorkflowClient.GetWorkflowStateAsync(orderId, orderId);
151149

152150
// Terminate the workflow
153-
await daprClient.TerminateWorkflowAsync(orderId, workflowComponent);
151+
await daprWorkflowClient.TerminateWorkflowAsync(orderId);
154152

155-
// Raise an event (an incoming purchase order) that your workflow will wait for. This returns the item waiting to be purchased.
156-
await daprClient.RaiseWorkflowEventAsync(orderId, workflowComponent, workflowName, input);
153+
// Raise an event (an incoming purchase order) that your workflow will wait for
154+
await daprWorkflowClient.RaiseEventAsync(orderId, "incoming-purchase-order", input);
157155

158156
// Pause
159-
await daprClient.PauseWorkflowAsync(orderId, workflowComponent);
157+
await daprWorkflowClient.SuspendWorkflowAsync(orderId);
160158

161159
// Resume
162-
await daprClient.ResumeWorkflowAsync(orderId, workflowComponent);
160+
await daprWorkflowClient.ResumeWorkflowAsync(orderId);
163161

164162
// Purge the workflow, removing all inbox and history information from associated instance
165-
await daprClient.PurgeWorkflowAsync(orderId, workflowComponent);
163+
await daprWorkflowClient.PurgeInstanceAsync(orderId);
166164
```
167165

168166
{{% /codetab %}}

0 commit comments

Comments
 (0)