mirror of https://github.com/dapr/java-sdk.git
Merge branch 'master' into fix-protoc
This commit is contained in:
commit
4264772d1e
|
|
@ -26,6 +26,7 @@ mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f testcontainers-dap
|
||||||
|
|
||||||
# dapr-spring
|
# dapr-spring
|
||||||
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -DprocessDependencies=true -f dapr-spring/pom.xml
|
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -DprocessDependencies=true -f dapr-spring/pom.xml
|
||||||
|
mvn versions:set-property -Dproperty=dapr.spring.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f dapr-spring/pom.xml
|
||||||
|
|
||||||
# spring-boot-examples
|
# spring-boot-examples
|
||||||
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f spring-boot-examples/pom.xml
|
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f spring-boot-examples/pom.xml
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@
|
||||||
<maven.compiler.release>11</maven.compiler.release>
|
<maven.compiler.release>11</maven.compiler.release>
|
||||||
<testcontainers.version>1.19.8</testcontainers.version>
|
<testcontainers.version>1.19.8</testcontainers.version>
|
||||||
<junit.version>5.11.2</junit.version>
|
<junit.version>5.11.2</junit.version>
|
||||||
<dapr.spring.version>0.16.0-SNAPSHOT</dapr.spring.version>
|
<!-- WARNING: don't change this property unless you also update .github/scripts/update_sdk_version.sh -->
|
||||||
|
<dapr.spring.version>0.17.0-SNAPSHOT</dapr.spring.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|
|
||||||
|
|
@ -526,4 +526,12 @@ public interface WorkflowContext {
|
||||||
default UUID newUuid() {
|
default UUID newUuid() {
|
||||||
throw new RuntimeException("No implementation found.");
|
throw new RuntimeException("No implementation found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a custom status to a workflow execution.
|
||||||
|
*
|
||||||
|
* @param status to be set to the current execution
|
||||||
|
*/
|
||||||
|
void setCustomStatus(Object status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class DefaultWorkflowContext implements WorkflowContext {
|
||||||
* @throws IllegalArgumentException if context or logger is null
|
* @throws IllegalArgumentException if context or logger is null
|
||||||
*/
|
*/
|
||||||
public DefaultWorkflowContext(TaskOrchestrationContext context, Logger logger)
|
public DefaultWorkflowContext(TaskOrchestrationContext context, Logger logger)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
throw new IllegalArgumentException("Context cannot be null");
|
throw new IllegalArgumentException("Context cannot be null");
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +114,7 @@ public class DefaultWorkflowContext implements WorkflowContext {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public <V> Task<V> waitForExternalEvent(String name, Duration timeout, Class<V> dataType)
|
public <V> Task<V> waitForExternalEvent(String name, Duration timeout, Class<V> dataType)
|
||||||
throws TaskCanceledException {
|
throws TaskCanceledException {
|
||||||
return this.innerContext.waitForExternalEvent(name, timeout, dataType);
|
return this.innerContext.waitForExternalEvent(name, timeout, dataType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +130,7 @@ public class DefaultWorkflowContext implements WorkflowContext {
|
||||||
* @param timeout the amount of time to wait before canceling the returned
|
* @param timeout the amount of time to wait before canceling the returned
|
||||||
* {@code Task}
|
* {@code Task}
|
||||||
* @return a new {@link Task} that completes when the external event is received
|
* @return a new {@link Task} that completes when the external event is received
|
||||||
* or when {@code timeout} expires
|
* or when {@code timeout} expires
|
||||||
* @throws TaskCanceledException if the specified {@code timeout} value expires
|
* @throws TaskCanceledException if the specified {@code timeout} value expires
|
||||||
* before the event is received
|
* before the event is received
|
||||||
*/
|
*/
|
||||||
|
|
@ -294,4 +294,13 @@ public class DefaultWorkflowContext implements WorkflowContext {
|
||||||
return workflowTaskRetryHandler.handle(workflowRetryContext);
|
return workflowTaskRetryHandler.handle(workflowRetryContext);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set custom status to a workflow execution.
|
||||||
|
*
|
||||||
|
* @param status to set to the execution
|
||||||
|
*/
|
||||||
|
public void setCustomStatus(Object status) {
|
||||||
|
innerContext.setCustomStatus(status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,11 @@ public class DefaultWorkflowContextTest {
|
||||||
@Override
|
@Override
|
||||||
public void continueAsNew(Object input, boolean preserveUnprocessedEvents) {
|
public void continueAsNew(Object input, boolean preserveUnprocessedEvents) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCustomStatus(Object status) {
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -403,6 +408,15 @@ public class DefaultWorkflowContextTest {
|
||||||
verify(mockInnerContext, times(1)).callSubOrchestrator(expectedName, expectedInput, null, null, String.class);
|
verify(mockInnerContext, times(1)).callSubOrchestrator(expectedName, expectedInput, null, null, String.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setCustomStatusWorkflow() {
|
||||||
|
String customStatus = "CustomStatus";
|
||||||
|
|
||||||
|
context.setCustomStatus(customStatus);
|
||||||
|
verify(mockInnerContext, times(1)).setCustomStatus(customStatus);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void newUuidTest() {
|
public void newUuidTest() {
|
||||||
context.newUuid();
|
context.newUuid();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue