You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daprdocs/content/en/java-sdk-docs/java-workflow/java-workflow-howto.md
+44-4Lines changed: 44 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ weight: 20000
6
6
description: How to get up and running with workflows using the Dapr Java SDK
7
7
---
8
8
9
-
Let’s create a Dapr workflow and invoke it using the console. With the [provided workflow example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows), you will:
9
+
Let's create a Dapr workflow and invoke it using the console. With the [provided workflow example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows), you will:
10
10
11
11
- Execute the workflow instance using the [Java workflow worker](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/DemoWorkflowWorker.java)
12
12
- Utilize the Java workflow client and API calls to [start and terminate workflow instances](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/DemoWorkflowClient.java)
@@ -85,11 +85,10 @@ You're up and running! Both Dapr and your app logs will appear here.
85
85
== APP == INFO: Durable Task worker is connecting to sidecar at 127.0.0.1:50001.
86
86
```
87
87
88
-
## Run the `DemoWorkflowClient
88
+
## Run the `DemoWorkflowClient`
89
89
90
90
The `DemoWorkflowClient` starts instances of workflows that have been registered with Dapr.
91
91
92
-
93
92
```java
94
93
publicclassDemoWorkflowClient {
95
94
@@ -246,4 +245,45 @@ Exiting DemoWorkflowClient.
246
245
247
246
## Next steps
248
247
-[Learn more about Dapr workflow]({{< ref workflow-overview.md >}})
249
-
-[Workflow API reference]({{< ref workflow_api.md >}})
248
+
-[Workflow API reference]({{< ref workflow_api.md >}})
249
+
250
+
## Advanced features
251
+
252
+
### Task Execution Keys
253
+
254
+
Task execution keys are unique identifiers generated by the durabletask-java library. They are stored in the `WorkflowActivityContext` and can be used to track and manage the execution of workflow activities. They are particularly useful for:
255
+
256
+
1.**Idempotency**: Ensuring activities are not executed multiple times for the same task
257
+
2.**State Management**: Tracking the state of activity execution
258
+
3.**Error Handling**: Managing retries and failures in a controlled manner
259
+
260
+
Here's an example of how to use task execution keys in your workflow activities:
0 commit comments