This is an automated email from the ASF dual-hosted git repository.
fjtiradosarti pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git
The following commit(s) were added to refs/heads/main by this push:
new ccdd1736c9 kie-kogito-runtimes-3388: Improve serverless workflows
timeouts duration validation message (#3433)
ccdd1736c9 is described below
commit ccdd1736c9956e30ae65cb7807894d53a827fc0e
Author: Walter Medvedeo <[email protected]>
AuthorDate: Mon Mar 11 11:42:30 2024 +0100
kie-kogito-runtimes-3388: Improve serverless workflows timeouts duration
validation message (#3433)
* kie-kogito-runtimes-3388: Improve serverless workflows timeouts duration
validation message
* Formatting fixes in classes not related to this PR
---
.../kie/kogito/serverless/workflow/utils/TimeoutsConfigResolver.java | 5 ++++-
.../kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java | 2 +-
.../kogito/quarkus/common/deployment/KogitoAssetsProcessorTest.java | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git
a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/TimeoutsConfigResolver.java
b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/TimeoutsConfigResolver.java
index 7a8bcb52a2..1e94b74510 100644
---
a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/TimeoutsConfigResolver.java
+++
b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/TimeoutsConfigResolver.java
@@ -30,7 +30,10 @@ import io.serverlessworkflow.api.timeouts.TimeoutsDefinition;
public class TimeoutsConfigResolver {
private static final String NON_NEGATIVE_DURATION_MUST_BE_PROVIDED =
- "When configured, it must be set with a greater than zero ISO 8601
time duration. For example PT30S. Or a valid expression, for example
$CONST.myDuration, where 'myDuration' is defined in the constant section of the
workflow";
+ "When configured, it must be set with a greater than zero ISO 8601
time duration. For example PT30S." +
+ " Or a valid expression, for example $CONST.myDuration,
where 'myDuration' is defined in the constant section of the workflow." +
+ " Note: month based durations like P2M (period of two
months) are not valid since the month duration might vary." +
+ " In that case you can use PT60D instead.";
private static final String INVALID_EVENT_TIMEOUT_FOR_STATE_ERROR = "An
invalid \"eventTimeout\": \"%s\" configuration was provided for the state
\"%s\" in the serverless workflow: \"%s\"." +
NON_NEGATIVE_DURATION_MUST_BE_PROVIDED;
diff --git
a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java
b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java
index 02a70d08d8..ab63a083fd 100644
---
a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java
+++
b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/main/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessor.java
@@ -107,7 +107,7 @@ public class KogitoAssetsProcessor {
@BuildStep
public KogitoBuildContextBuildItem
generateKogitoBuildContext(List<KogitoBuildContextAttributeBuildItem>
attributes) {
// configure the application generator
- PathCollection rootPaths = getRootPaths( root.getResolvedPaths());
+ PathCollection rootPaths = getRootPaths(root.getResolvedPaths());
KogitoBuildContext context =
kogitoBuildContext(outputTargetBuildItem.getOutputDirectory(),
rootPaths,
diff --git
a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/test/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessorTest.java
b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/test/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessorTest.java
index 1adeac2ce6..9220b7d2c6 100644
---
a/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/test/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessorTest.java
+++
b/quarkus/extensions/kogito-quarkus-extension-common/kogito-quarkus-common-deployment/src/test/java/org/kie/kogito/quarkus/common/deployment/KogitoAssetsProcessorTest.java
@@ -4,9 +4,10 @@ import java.io.File;
import java.nio.file.Path;
import java.util.Arrays;
+import org.junit.jupiter.api.Test;
+
import io.quarkus.bootstrap.model.PathsCollection;
import io.quarkus.paths.PathCollection;
-import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -43,4 +44,4 @@ class KogitoAssetsProcessorTest {
String expectedPath = String.format("%s/%s/generated-resources",
projectDirPath, outputTargetPath).replace("/", File.separator);
assertTrue(retrieved.contains(Path.of(expectedPath)));
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]