Skip to content

Commit 416d322

Browse files
authored
Merge branch 'v1.16' into remove-algolia-workflow
2 parents 7bae07e + 76ed1a9 commit 416d322

File tree

2 files changed

+64
-46
lines changed

2 files changed

+64
-46
lines changed

daprdocs/content/en/contributing/presentations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ weight: 20
66
description: How to give a presentation on Dapr and examples
77
---
88

9-
We encourage community members to give presentations on Dapr. To get you started quickly, we offer two PowerPoint files:
9+
We encourage community members to give presentations on Dapr. To get you started quickly, we offer three PowerPoint files:
1010

11-
- *dapr-slidedeck.pptx*, this is a 150+ page slide deck and contains; an overview of Dapr, all of its building block APIs, cross-cutting concerns, hosting options, and assets to create your own architecture diagrams.
12-
- *dapr-workflow-slidedeck.pptx*, this is a dedicated slide deck about Dapr Workflow and contains; durable execution concept, workflow authoring, workflow patterns, workflow management, and challenges & tips.
13-
- *dapr-agents-slidedeck.pptx*, this is a dedicated slide deck about Dapr Agents and contains; AI agents explanation, Dapr Agent types, multi-agent systems, and agentic patterns.
11+
- *dapr-slidedeck.pptx*, this is a 150+ page slide deck and contains: an overview of Dapr, all of its building block APIs, cross-cutting concerns, hosting options, and assets to create your own architecture diagrams.
12+
- *dapr-workflow-slidedeck.pptx*, this is a dedicated slide deck about Dapr Workflow and contains: durable execution concept, workflow authoring, workflow patterns, workflow management, and challenges & tips.
13+
- *dapr-agents-slidedeck.pptx*, this is a dedicated slide deck about Dapr Agents and contains: AI agents explanation, Dapr Agent types, multi-agent systems, and agentic patterns.
1414

1515
There is a downloadable zip file that contains all slide decks.
1616

@@ -25,7 +25,7 @@ brew install --cask font-space-grotesk
2525

2626
## Giving a Dapr presentation
2727

28-
- Begin by downloading the [Dapr Presentation Decks](/presentations/dapr-slidedecks.zip). These contain slides, diagrams, and graphical assets needed to give a Dapr presentation.
28+
- Begin by downloading the [Dapr Presentation Decks](/presentations/dapr-slidedecks.zip). These contain slides, diagrams, and graphical assets.
2929
- Next, review the docs to make sure you understand the [concepts]({{% ref concepts %}}).
3030
- Use the Dapr [quickstarts](https://github.com/dapr/quickstarts) repo to show demos of how to use Dapr.
3131
- Once you've done a Dapr presentation, claim the *Dapr Presenter* badge by adding your presentation to [this table](https://github.com/dapr/community/tree/master/presentations) in the Dapr Community repository.

daprdocs/content/en/developing-applications/building-blocks/state-management/howto-outbox.md

Lines changed: 59 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -322,30 +322,45 @@ public class Main {
322322
public static void main(String[] args) {
323323
try (DaprClient client = new DaprClientBuilder().build()) {
324324
// Define the first state operation to save the value "2"
325-
StateOperation<String> op1 = new StateOperation<>(
326-
StateOperationType.UPSERT,
325+
State<String> state1 = new State<>(
327326
"key1",
328-
"2"
327+
"2",
328+
null, // etag
329+
null // concurrency and consistency options
329330
);
330331
331332
// Define the second state operation to publish the value "3" with metadata
332333
Map<String, String> metadata = new HashMap<>();
333334
metadata.put("outbox.projection", "true");
334335
335-
StateOperation<String> op2 = new StateOperation<>(
336-
StateOperationType.UPSERT,
336+
State<String> state2 = new State<>(
337337
"key1",
338338
"3",
339-
metadata
339+
null, // etag
340+
metadata,
341+
null // concurrency and consistency options
342+
);
343+
344+
TransactionalStateOperation<String> op1 = new TransactionalStateOperation<>(
345+
TransactionalStateOperation.OperationType.UPSERT, state1
346+
);
347+
348+
TransactionalStateOperation<String> op2 = new TransactionalStateOperation<>(
349+
TransactionalStateOperation.OperationType.UPSERT, state2
340350
);
341351
342-
// Create the list of state operations
343-
List<StateOperation<?>> ops = new ArrayList<>();
352+
// Create the list of transaction state operations
353+
List<TransactionalStateOperation<?>> ops = new ArrayList<>();
344354
ops.add(op1);
345355
ops.add(op2);
346356
357+
// Configure transaction request setting the state store
358+
ExecuteStateTransactionRequest transactionRequest = new ExecuteStateTransactionRequest(DAPR_STORE_NAME);
359+
360+
transactionRequest.setOperations(ops);
361+
347362
// Execute the state transaction
348-
client.executeStateTransaction(DAPR_STORE_NAME, ops).block();
363+
client.executeStateTransaction(transactionRequest).block();
349364
System.out.println("State transaction executed.");
350365
} catch (Exception e) {
351366
e.printStackTrace();
@@ -595,39 +610,42 @@ public class StateOperationExample {
595610
executeStateTransaction();
596611
}
597612
598-
public static void executeStateTransaction() {
599-
// Build Dapr client
600-
try (DaprClient daprClient = new DaprClientBuilder().build()) {
601-
602-
// Define the value "2"
603-
String value = "2";
604-
605-
// Override CloudEvent metadata
606-
Map<String, String> metadata = new HashMap<>();
607-
metadata.put("cloudevent.id", "unique-business-process-id");
608-
metadata.put("cloudevent.source", "CustomersApp");
609-
metadata.put("cloudevent.type", "CustomerCreated");
610-
metadata.put("cloudevent.subject", "123");
611-
metadata.put("my-custom-ce-field", "abc");
612-
613-
// Define state operations
614-
List<StateOperation<?>> ops = new ArrayList<>();
615-
StateOperation<String> op1 = new StateOperation<>(
616-
StateOperationType.UPSERT,
617-
"key1",
618-
value,
619-
metadata
620-
);
621-
ops.add(op1);
622-
623-
// Execute state transaction
624-
String storeName = "your-state-store-name";
625-
daprClient.executeStateTransaction(storeName, ops).block();
626-
System.out.println("State transaction executed.");
627-
} catch (Exception e) {
628-
e.printStackTrace();
629-
}
613+
public static void executeStateTransaction() {
614+
// Build Dapr client
615+
try (DaprClient daprClient = new DaprClientBuilder().build()) {
616+
617+
// Override CloudEvent metadata
618+
Map<String, String> metadata = new HashMap<>();
619+
metadata.put("cloudevent.id", "unique-business-process-id");
620+
metadata.put("cloudevent.source", "CustomersApp");
621+
metadata.put("cloudevent.type", "CustomerCreated");
622+
metadata.put("cloudevent.subject", "123");
623+
metadata.put("my-custom-ce-field", "abc");
624+
625+
State<String> state = new State<>(
626+
"key1", // Define the key "key1"
627+
"value1", // Define the value "value1"
628+
null, // etag
629+
metadata,
630+
null // concurrency and consistency options
631+
);
632+
633+
// Define state operations
634+
List<TransactionalStateOperation<?>> ops = new ArrayList<>();
635+
TransactionalStateOperation<String> op1 = new TransactionalStateOperation<>(
636+
TransactionalStateOperation.OperationType.UPSERT,
637+
state
638+
);
639+
ops.add(op1);
640+
641+
// Execute state transaction
642+
String storeName = "your-state-store-name";
643+
daprClient.executeStateTransaction(storeName, ops).block();
644+
System.out.println("State transaction executed.");
645+
} catch (Exception e) {
646+
e.printStackTrace();
630647
}
648+
}
631649
}
632650
```
633651
{{% /tab %}}

0 commit comments

Comments
 (0)