@@ -138,31 +138,29 @@ Manage your workflow within your code. In the `OrderProcessingWorkflow` example
138138
139139``` csharp
140140string orderId = " exampleOrderId" ;
141- string workflowComponent = " dapr" ;
142- string workflowName = " OrderProcessingWorkflow" ;
143141OrderPayload input = new OrderPayload (" Paperclips" , 99 . 95 );
144142Dictionary < 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