From d85b49abb7473cd4c1b8cb4bc45a7afaa0359ed7 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 9 May 2023 10:05:04 -0400 Subject: [PATCH] remove python examples until ready Signed-off-by: Hannah Hunter --- .../workflow/howto-author-workflow.md | 81 +------------------ 1 file changed, 3 insertions(+), 78 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md index bc326c429..f275c5ddd 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md @@ -28,7 +28,7 @@ The Dapr sidecar doesn’t load any workflow definitions. Rather, the sidecar si ## Write the workflow activities -Define the workflow activities you'd like your workflow to perform. Activities are a class definition and can take inputs and outputs. Activities also participate in dependency injection, like binding to a Dapr client. +Define the workflow activities you’d like your workflow to perform. Activities are a class definition and can take inputs and outputs. Activities also participate in dependency injection, like binding to a Dapr client. {{< tabs ".NET" Python >}} @@ -87,55 +87,7 @@ It also includes a `RunAsync` method that does the heavy lifting of the workflow - HTTP API calls to start, pause, resume, terminate, and purge the workflow. ```python -from dapr.clients import DaprClient - -from dapr.clients.grpc._helpers import to_bytes -# ... - -# Dapr Workflows are registered as part of the service configuration -with DaprClient() as d: - instanceId = "RRLINSTANCEID35" - workflowComponent = "dapr" - workflowName = "PlaceOrder" - workflowOptions = dict() - workflowOptions["task_queue"] = "testQueue" - inventoryItem = ("Computers", 5, 10) - item2 = "paperclips" - - encoded_data = b''.join(bytes(str(element), 'UTF-8') for element in item2) - encoded_data2 = json.dumps(item2).encode("UTF-8") - - # ... - - # Start the workflow - start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent, - workflow_name=workflowName, input=encoded_data2, workflow_options=workflowOptions) - print(f"Attempting to start {workflowName}") - print(f"start_resp {start_resp.instance_id}") - # Get workflow status - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after start call: {getResponse.runtime_status}") - - # Pause Test - d.pause_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after pause call: {getResponse.runtime_status}") - - # Resume Test - d.resume_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after resume call: {getResponse.runtime_status}") - - # Terminate Test - d.terminate_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after terminate call: {getResponse.runtime_status}") - - # Purge Test - d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent) - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after purge call: {getResponse}") - +todo ``` @@ -232,34 +184,7 @@ app.Run(); - HTTP API calls to start, pause, resume, terminate, and purge the workflow. ```python -from dapr.clients import DaprClient - -from dapr.clients.grpc._helpers import to_bytes -# ... - -# Dapr Workflows are registered as part of the service configuration -with DaprClient() as d: - instanceId = "RRLINSTANCEID35" - workflowComponent = "dapr" - workflowName = "PlaceOrder" - workflowOptions = dict() - workflowOptions["task_queue"] = "testQueue" - inventoryItem = ("Computers", 5, 10) - item2 = "paperclips" - - encoded_data = b''.join(bytes(str(element), 'UTF-8') for element in item2) - encoded_data2 = json.dumps(item2).encode("UTF-8") - - # ... - - # Start the workflow - start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent, - workflow_name=workflowName, input=encoded_data2, workflow_options=workflowOptions) - print(f"Attempting to start {workflowName}") - print(f"start_resp {start_resp.instance_id}") - # Get workflow status - getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent) - print(f"Get response from {workflowName} after start call: {getResponse.runtime_status}") +todo ```