Skip to content

Commit

Permalink
Add README and minor fix waitForCompletionStates name (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Feb 21, 2024
1 parent 392a3c5 commit 5d52f3d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -23,7 +23,7 @@ For the latest version, [MVN Repository](https://mvnrepository.com/artifact/io.i

```gradle
// https://mvnrepository.com/artifact/io.iworkflow/iwf-java-sdk
implementation 'io.iworkflow:iwf-java-sdk:2.2.+'
implementation 'io.iworkflow:iwf-java-sdk:2.5.+'
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation 'io.iworkflow:iwf-java-sdk:2.2.+'
<dependency>
<groupId>io.iworkflow</groupId>
<artifactId>iwf-java-sdk</artifactId>
<version>2.2.+</version>
<version>2.5.+</version>
<type>pom</type>
</dependency>
Expand Down Expand Up @@ -135,4 +135,8 @@ Run the command `git submodule update --remote --merge` to update IDL to the lat
### 2.4

- [x] Support execute API failure policy
- [x] Support RPC persistence locking policy
- [x] Support RPC persistence locking policy

### 2.5

- [x] Add waitForStateExecutionCompletion API
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -161,7 +161,7 @@ signing {
}

group = "io.iworkflow"
version = "2.5.1"
version = "2.5.4"

nexusPublishing {
repositories {
Expand Down
Expand Up @@ -14,7 +14,7 @@ public class WorkflowOptionBuilderExtension {
* @param states The states to wait for completion. O
* @return The builder.
*/
public WorkflowOptionBuilderExtension WaitForCompletionStates(Class<? extends WorkflowState> ...states) {
public WorkflowOptionBuilderExtension waitForCompletionStates(Class<? extends WorkflowState> ...states) {
Arrays.stream(states).forEach(
state -> builder.addWaitForCompletionStateExecutionIds(
WorkflowState.getStateExecutionId(state,1)
Expand All @@ -28,7 +28,7 @@ public WorkflowOptionBuilderExtension WaitForCompletionStates(Class<? extends Wo
* @param number The number of the state completion to wait for. E.g. when it's 2, it's waiting for the second completion of the state.
* @return The builder.
*/
public WorkflowOptionBuilderExtension WaitForCompletionStateWithNumber(Class<? extends WorkflowState> state, int number) {
public WorkflowOptionBuilderExtension waitForCompletionStateWithNumber(Class<? extends WorkflowState> state, int number) {
builder.addWaitForCompletionStateExecutionIds(
WorkflowState.getStateExecutionId(state, number)
);
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/io/iworkflow/integ/TimerTest.java
Expand Up @@ -2,8 +2,6 @@

import io.iworkflow.core.Client;
import io.iworkflow.core.ClientOptions;
import io.iworkflow.core.ImmutableWorkflowOptions;
import io.iworkflow.core.WorkflowOptionBuilderExtension;
import io.iworkflow.core.WorkflowOptions;
import io.iworkflow.integ.timer.BasicTimerWorkflow;
import io.iworkflow.integ.timer.BasicTimerWorkflowState1;
Expand Down Expand Up @@ -32,7 +30,7 @@ public void testBasicTimerWorkflow() throws InterruptedException {
client.startWorkflow(
BasicTimerWorkflow.class, wfId, 10, input,
WorkflowOptions.extendedBuilder()
.WaitForCompletionStates(BasicTimerWorkflowState1.class)
.waitForCompletionStates(BasicTimerWorkflowState1.class)
.getBuilder().build());

client.waitForStateExecutionCompletion(wfId, BasicTimerWorkflowState1.class);
Expand Down

0 comments on commit 5d52f3d

Please sign in to comment.