Skip to content

Commit 6e94ef7

Browse files
committed
Change API and documentation
Signed-off-by: Matheus Cruz <[email protected]>
1 parent a7d426a commit 6e94ef7

File tree

37 files changed

+1084
-256
lines changed

37 files changed

+1084
-256
lines changed

dapr-spring/pom.xml

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<groupId>io.dapr.spring</groupId>
1414
<artifactId>dapr-spring-parent</artifactId>
1515
<packaging>pom</packaging>
16-
<version>1.17.0-SNAPSHOT</version>
1716
<name>dapr-spring-parent</name>
1817
<description>SDK extension for Spring and Spring Boot</description>
1918

@@ -31,35 +30,12 @@
3130
<maven.compiler.source>11</maven.compiler.source>
3231
<maven.compiler.target>11</maven.compiler.target>
3332
<maven.compiler.release>11</maven.compiler.release>
34-
<testcontainers.version>1.19.8</testcontainers.version>
35-
<junit.version>5.11.2</junit.version>
3633
<!-- WARNING: don't change this property unless you also update .github/scripts/update_sdk_version.sh -->
3734
<dapr.spring.version>1.17.0-SNAPSHOT</dapr.spring.version>
3835
</properties>
3936

4037
<dependencyManagement>
4138
<dependencies>
42-
<dependency>
43-
<groupId>org.springframework.boot</groupId>
44-
<artifactId>spring-boot-dependencies</artifactId>
45-
<version>${springboot.version}</version>
46-
<type>pom</type>
47-
</dependency>
48-
<dependency>
49-
<groupId>io.dapr</groupId>
50-
<artifactId>dapr-sdk</artifactId>
51-
<version>${dapr.sdk.version}</version>
52-
</dependency>
53-
<dependency>
54-
<groupId>io.dapr</groupId>
55-
<artifactId>dapr-sdk-actors</artifactId>
56-
<version>${dapr.sdk.version}</version>
57-
</dependency>
58-
<dependency>
59-
<groupId>io.dapr</groupId>
60-
<artifactId>dapr-sdk-workflows</artifactId>
61-
<version>${dapr.sdk.version}</version>
62-
</dependency>
6339
<dependency>
6440
<groupId>io.dapr.spring</groupId>
6541
<artifactId>dapr-spring-data</artifactId>
@@ -80,86 +56,11 @@
8056
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
8157
<version>${dapr.spring.version}</version>
8258
</dependency>
83-
<dependency>
84-
<groupId>io.dapr</groupId>
85-
<artifactId>dapr-sdk-springboot</artifactId>
86-
<version>${dapr.sdk.version}</version>
87-
</dependency>
88-
<dependency>
89-
<groupId>org.springframework</groupId>
90-
<artifactId>spring-context</artifactId>
91-
<version>${springframework.version}</version>
92-
</dependency>
93-
<dependency>
94-
<groupId>org.springframework</groupId>
95-
<artifactId>spring-beans</artifactId>
96-
<version>${springframework.version}</version>
97-
</dependency>
98-
99-
<!-- Spring dependencies -->
100-
<dependency>
101-
<groupId>org.springframework</groupId>
102-
<artifactId>spring-web</artifactId>
103-
<version>${springframework.version}</version>
104-
</dependency>
105-
<dependency>
106-
<groupId>org.springframework.boot</groupId>
107-
<artifactId>spring-boot-configuration-processor</artifactId>
108-
<version>${springboot.version}</version>
109-
</dependency>
110-
<dependency>
111-
<groupId>org.springframework.boot</groupId>
112-
<artifactId>spring-boot-starter</artifactId>
113-
<version>${springboot.version}</version>
114-
</dependency>
115-
<dependency>
116-
<groupId>org.springframework.boot</groupId>
117-
<artifactId>spring-boot-autoconfigure-processor</artifactId>
118-
<version>${springboot.version}</version>
119-
</dependency>
12059
<dependency>
12160
<groupId>io.dapr.spring</groupId>
12261
<artifactId>dapr-spring-boot-tests</artifactId>
12362
<version>${dapr.spring.version}</version>
12463
</dependency>
125-
126-
<!-- Test dependencies -->
127-
<dependency>
128-
<groupId>org.junit.jupiter</groupId>
129-
<artifactId>junit-jupiter-api</artifactId>
130-
<version>${junit.version}</version>
131-
<scope>test</scope>
132-
</dependency>
133-
<dependency>
134-
<groupId>org.springframework.boot</groupId>
135-
<artifactId>spring-boot-starter-test</artifactId>
136-
<version>${springboot.version}</version>
137-
<scope>test</scope>
138-
</dependency>
139-
<dependency>
140-
<groupId>org.junit.jupiter</groupId>
141-
<artifactId>junit-jupiter-params</artifactId>
142-
<version>${junit.version}</version>
143-
<scope>test</scope>
144-
</dependency>
145-
<dependency>
146-
<groupId>org.junit.jupiter</groupId>
147-
<artifactId>junit-jupiter-engine</artifactId>
148-
<version>${junit.version}</version>
149-
<scope>test</scope>
150-
</dependency>
151-
<dependency>
152-
<groupId>org.junit.jupiter</groupId>
153-
<artifactId>junit-jupiter</artifactId>
154-
<version>${junit.version}</version>
155-
<scope>test</scope>
156-
</dependency>
157-
<dependency>
158-
<groupId>org.testcontainers</groupId>
159-
<artifactId>junit-jupiter</artifactId>
160-
<version>${testcontainers.version}</version>
161-
<scope>test</scope>
162-
</dependency>
16364
</dependencies>
16465
</dependencyManagement>
16566

daprdocs/content/en/java-sdk-docs/java-client/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ public class DistributedLockGrpcClient {
486486
package io.dapr.examples.workflows;
487487

488488
import io.dapr.workflows.client.DaprWorkflowClient;
489-
import io.dapr.workflows.client.WorkflowInstanceStatus;
489+
import io.dapr.workflows.client.WorkflowState;
490490

491491
import java.time.Duration;
492492
import java.util.concurrent.TimeUnit;
@@ -513,18 +513,18 @@ public class DemoWorkflowClient {
513513
System.out.printf("Started new workflow instance with random ID: %s%n", instanceId);
514514

515515
System.out.println(separatorStr);
516-
System.out.println("**GetInstanceMetadata:Running Workflow**");
517-
WorkflowInstanceStatus workflowMetadata = client.getInstanceState(instanceId, true);
516+
System.out.println("**GetWorkflowMetadata:Running Workflow**");
517+
WorkflowState workflowMetadata = client.getWorkflowState(instanceId, true);
518518
System.out.printf("Result: %s%n", workflowMetadata);
519519

520520
System.out.println(separatorStr);
521-
System.out.println("**WaitForInstanceStart**");
521+
System.out.println("**WaitForWorkflowStart**");
522522
try {
523-
WorkflowInstanceStatus waitForInstanceStartResult =
524-
client.waitForInstanceStart(instanceId, Duration.ofSeconds(60), true);
525-
System.out.printf("Result: %s%n", waitForInstanceStartResult);
523+
WorkflowState waitForWorkflowStartResult =
524+
client.waitForWorkflowStart(instanceId, Duration.ofSeconds(60), true);
525+
System.out.printf("Result: %s%n", waitForWorkflowStartResult);
526526
} catch (TimeoutException ex) {
527-
System.out.printf("waitForInstanceStart has an exception:%s%n", ex);
527+
System.out.printf("waitForWorkflowStart has an exception:%s%n", ex);
528528
}
529529

530530
System.out.println(separatorStr);
@@ -545,18 +545,18 @@ public class DemoWorkflowClient {
545545

546546

547547
System.out.println(separatorStr);
548-
System.out.println("**WaitForInstanceCompletion**");
548+
System.out.println("**waitForWorkflowCompletion**");
549549
try {
550-
WorkflowInstanceStatus waitForInstanceCompletionResult =
551-
client.waitForInstanceCompletion(instanceId, Duration.ofSeconds(60), true);
552-
System.out.printf("Result: %s%n", waitForInstanceCompletionResult);
550+
WorkflowState waitForWorkflowCompletionResult =
551+
client.waitForWorkflowCompletion(instanceId, Duration.ofSeconds(60), true);
552+
System.out.printf("Result: %s%n", waitForWorkflowCompletionResult);
553553
} catch (TimeoutException ex) {
554-
System.out.printf("waitForInstanceCompletion has an exception:%s%n", ex);
554+
System.out.printf("waitForWorkflowCompletion has an exception:%s%n", ex);
555555
}
556556

557557
System.out.println(separatorStr);
558-
System.out.println("**purgeInstance**");
559-
boolean purgeResult = client.purgeInstance(instanceId);
558+
System.out.println("**purgeWorkflow**");
559+
boolean purgeResult = client.purgeWorkflow(instanceId);
560560
System.out.printf("purgeResult: %s%n", purgeResult);
561561

562562
System.out.println(separatorStr);

daprdocs/content/en/java-sdk-docs/java-workflow/java-workflow-howto.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ public class DemoWorkflowClient {
104104

105105
System.out.println(separatorStr);
106106
System.out.println("**GetInstanceMetadata:Running Workflow**");
107-
WorkflowInstanceStatus workflowMetadata = client.getInstanceState(instanceId, true);
107+
WorkflowState workflowMetadata = client.getWorkflowState(instanceId, true);
108108
System.out.printf("Result: %s%n", workflowMetadata);
109109

110110
System.out.println(separatorStr);
111-
System.out.println("**WaitForInstanceStart**");
111+
System.out.println("**WaitForWorkflowStart**");
112112
try {
113-
WorkflowInstanceStatus waitForInstanceStartResult =
114-
client.waitForInstanceStart(instanceId, Duration.ofSeconds(60), true);
115-
System.out.printf("Result: %s%n", waitForInstanceStartResult);
113+
WorkflowState waitForWorkflowStartResult =
114+
client.waitForWorkflowStart(instanceId, Duration.ofSeconds(60), true);
115+
System.out.printf("Result: %s%n", waitForWorkflowStartResult);
116116
} catch (TimeoutException ex) {
117-
System.out.printf("waitForInstanceStart has an exception:%s%n", ex);
117+
System.out.printf("waitForWorkflowStart has an exception:%s%n", ex);
118118
}
119119

120120
System.out.println(separatorStr);
@@ -135,13 +135,13 @@ public class DemoWorkflowClient {
135135

136136

137137
System.out.println(separatorStr);
138-
System.out.println("**WaitForInstanceCompletion**");
138+
System.out.println("**waitForWorkflowCompletion**");
139139
try {
140-
WorkflowInstanceStatus waitForInstanceCompletionResult =
141-
client.waitForInstanceCompletion(instanceId, Duration.ofSeconds(60), true);
142-
System.out.printf("Result: %s%n", waitForInstanceCompletionResult);
140+
WorkflowState waitForWorkflowCompletionResult =
141+
client.waitForWorkflowCompletion(instanceId, Duration.ofSeconds(60), true);
142+
System.out.printf("Result: %s%n", waitForWorkflowCompletionResult);
143143
} catch (TimeoutException ex) {
144-
System.out.printf("waitForInstanceCompletion has an exception:%s%n", ex);
144+
System.out.printf("waitForWorkflowCompletion has an exception:%s%n", ex);
145145
}
146146

147147
System.out.println(separatorStr);
@@ -213,7 +213,7 @@ Events raised for workflow with instanceId: 0b4cc0d5-413a-4c1c-816a-a71fa24740d4
213213
** Registering Event to be captured by anyOf(t1,t2,t3) **
214214
Event raised for workflow with instanceId: 0b4cc0d5-413a-4c1c-816a-a71fa24740d4
215215
*******
216-
**WaitForInstanceCompletion**
216+
**WaitForWorkflowCompletion**
217217
Result: [Name: 'io.dapr.examples.workflows.DemoWorkflow', ID: '0b4cc0d5-413a-4c1c-816a-a71fa24740d4', RuntimeStatus: FAILED, CreatedAt: 2023-09-13T13:02:30.547Z, LastUpdatedAt: 2023-09-13T13:02:55.054Z, Input: '"input data"', Output: '']
218218
*******
219219
**purgeInstance**

examples/pom.xml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
<artifactId>dapr-sdk-examples</artifactId>
1414
<packaging>jar</packaging>
15-
<version>1.17.0-SNAPSHOT</version>
1615
<name>dapr-sdk-examples</name>
1716

1817
<properties>
@@ -22,81 +21,65 @@
2221
<maven.compiler.source>${java.version}</maven.compiler.source>
2322
<maven.compiler.target>${java.version}</maven.compiler.target>
2423
<spotbugs.fail>false</spotbugs.fail>
25-
<opentelemetry.version>1.41.0</opentelemetry.version>
26-
<zipkin.version>3.4.0</zipkin.version>
2724
</properties>
2825

2926
<dependencies>
3027
<dependency>
3128
<groupId>commons-cli</groupId>
3229
<artifactId>commons-cli</artifactId>
33-
<version>1.9.0</version>
3430
</dependency>
3531
<dependency>
3632
<groupId>io.grpc</groupId>
3733
<artifactId>grpc-protobuf</artifactId>
38-
<version>${grpc.version}</version>
3934
</dependency>
4035
<dependency>
4136
<groupId>io.grpc</groupId>
4237
<artifactId>grpc-stub</artifactId>
43-
<version>${grpc.version}</version>
4438
</dependency>
4539
<dependency>
4640
<groupId>io.grpc</groupId>
4741
<artifactId>grpc-api</artifactId>
48-
<version>${grpc.version}</version>
4942
</dependency>
5043
<dependency>
5144
<groupId>io.grpc</groupId>
5245
<artifactId>grpc-testing</artifactId>
53-
<version>${grpc.version}</version>
5446
<scope>test</scope>
5547
</dependency>
5648
<dependency>
5749
<groupId>com.google.protobuf</groupId>
5850
<artifactId>protobuf-java-util</artifactId>
59-
<version>${protobuf.version}</version>
6051
</dependency>
6152
<dependency>
6253
<groupId>org.springframework.boot</groupId>
6354
<artifactId>spring-boot-starter-web</artifactId>
64-
<version>${springboot.version}</version>
6555
</dependency>
6656
<dependency>
6757
<groupId>com.jayway.jsonpath</groupId>
6858
<artifactId>json-path</artifactId>
69-
<version>2.9.0</version>
7059
</dependency>
7160
<dependency>
7261
<groupId>io.opentelemetry</groupId>
7362
<artifactId>opentelemetry-sdk</artifactId>
74-
<version>${opentelemetry.version}</version>
7563
</dependency>
7664
<dependency>
7765
<groupId>io.opentelemetry</groupId>
7866
<artifactId>opentelemetry-exporter-logging</artifactId>
79-
<version>${opentelemetry.version}</version>
8067
</dependency>
8168
<dependency>
8269
<groupId>io.opentelemetry</groupId>
8370
<artifactId>opentelemetry-sdk-metrics</artifactId>
84-
<version>${opentelemetry.version}</version>
8571
</dependency>
8672
<dependency>
8773
<groupId>io.opentelemetry</groupId>
8874
<artifactId>opentelemetry-exporter-zipkin</artifactId>
89-
<version>${opentelemetry.version}</version>
9075
</dependency>
9176
<dependency>
9277
<groupId>io.zipkin.reporter2</groupId>
9378
<artifactId>zipkin-reporter</artifactId>
94-
<version>${zipkin.version}</version>
9579
</dependency>
9680
<dependency>
9781
<groupId>io.zipkin.reporter2</groupId>
9882
<artifactId>zipkin-sender-urlconnection</artifactId>
99-
<version>${zipkin.version}</version>
10083
</dependency>
10184
<dependency>
10285
<groupId>org.junit.jupiter</groupId>
@@ -111,7 +94,6 @@
11194
<dependency>
11295
<groupId>org.junit.platform</groupId>
11396
<artifactId>junit-platform-console-standalone</artifactId>
114-
<version>1.7.0</version>
11597
<scope>compile</scope>
11698
</dependency>
11799
<dependency>
@@ -127,7 +109,7 @@
127109
<dependency>
128110
<groupId>io.dapr</groupId>
129111
<artifactId>dapr-sdk-workflows</artifactId>
130-
<version>${dapr.sdk.version}</version>
112+
<version>${project.version}</version>
131113
</dependency>
132114
<dependency>
133115
<groupId>io.dapr</groupId>
@@ -137,17 +119,14 @@
137119
<dependency>
138120
<groupId>com.evanlennick</groupId>
139121
<artifactId>retry4j</artifactId>
140-
<version>0.15.0</version>
141122
</dependency>
142123
<dependency>
143124
<groupId>javax.annotation</groupId>
144125
<artifactId>javax.annotation-api</artifactId>
145-
<version>1.3.2</version>
146126
</dependency>
147127
<dependency>
148128
<groupId>com.google.protobuf</groupId>
149129
<artifactId>protobuf-java</artifactId>
150-
<version>${protobuf.version}</version>
151130
</dependency>
152131
</dependencies>
153132

examples/src/main/java/io/dapr/examples/workflows/chain/DemoChainClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import io.dapr.examples.workflows.utils.PropertyUtils;
1717
import io.dapr.examples.workflows.utils.RetryUtils;
1818
import io.dapr.workflows.client.DaprWorkflowClient;
19-
import io.dapr.workflows.client.WorkflowInstanceStatus;
19+
import io.dapr.workflows.client.WorkflowState;
2020

2121
import java.time.Duration;
2222
import java.util.concurrent.TimeoutException;
@@ -34,10 +34,10 @@ public static void main(String[] args) {
3434
Duration.ofSeconds(60));
3535

3636
System.out.printf("Started a new chaining model workflow with instance ID: %s%n", instanceId);
37-
WorkflowInstanceStatus workflowInstanceStatus =
38-
client.waitForInstanceCompletion(instanceId, null, true);
37+
WorkflowState workflowState =
38+
client.waitForWorkflowCompletion(instanceId, null, true);
3939

40-
String result = workflowInstanceStatus.readOutputAs(String.class);
40+
String result = workflowState.readOutputAs(String.class);
4141
System.out.printf("workflow instance with ID: %s completed with result: %s%n", instanceId, result);
4242
} catch (TimeoutException | InterruptedException e) {
4343
throw new RuntimeException(e);

0 commit comments

Comments
 (0)