You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "martinweiler (via GitHub)" <gi...@apache.org> on 2026/01/28 22:34:32 UTC
[PR] [incubator-kie-issues#2230] Fix deadlines parsing errors [incubator-kie-kogito-runtimes]
martinweiler opened a new pull request, #4177:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4177
Closes https://github.com/apache/incubator-kie-issues/issues/2230
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2230] Fix deadlines parsing errors [incubator-kie-kogito-runtimes]
Posted by "martinweiler (via GitHub)" <gi...@apache.org>.
martinweiler commented on code in PR #4177:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4177#discussion_r2755616933
##########
jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java:
##########
@@ -130,10 +130,23 @@ private static <T> DeadlineInfo<T> parseDeadline(String text,
private static Collection<ScheduleInfo> getReassignmentSchedule(String timeStr) {
ScheduleInfo info = new ScheduleInfo();
- if (!timeStr.startsWith("PT")) {
- timeStr = "PT" + timeStr;
+ // Check if it's a shorthand duration (e.g., "1m", "2h")
+ Duration shorthandDuration = parseShorthandDuration(timeStr);
+ if (shorthandDuration != null) {
+ info.setDuration(shorthandDuration);
+ } else if (!timeStr.startsWith("PT") && !timeStr.startsWith("P")) {
+ // If not already prefixed with P or PT, determine which prefix to use
+ // Check if it contains time components (H, M, S) or date components (Y, W, D)
+ // Note: M is ambiguous (could be months or minutes), so we check for T presence
+ if (timeStr.contains("T") || timeStr.matches(".*[0-9]+[HMS].*")) {
Review Comment:
Good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2230] Fix deadlines parsing errors [incubator-kie-kogito-runtimes]
Posted by "pefernan (via GitHub)" <gi...@apache.org>.
pefernan commented on code in PR #4177:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4177#discussion_r2827074811
##########
jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java:
##########
@@ -295,6 +313,13 @@ Duration toDuration(long value) {
return Duration.ofDays(value * 7);
}
},
+ MONTHS("M") {
Review Comment:
good catch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2230] Fix deadlines parsing errors [incubator-kie-kogito-runtimes]
Posted by "pefernan (via GitHub)" <gi...@apache.org>.
pefernan merged PR #4177:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4177
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2230] Fix deadlines parsing errors [incubator-kie-kogito-runtimes]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #4177:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4177#discussion_r2740086321
##########
jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java:
##########
@@ -130,10 +130,23 @@ private static <T> DeadlineInfo<T> parseDeadline(String text,
private static Collection<ScheduleInfo> getReassignmentSchedule(String timeStr) {
ScheduleInfo info = new ScheduleInfo();
- if (!timeStr.startsWith("PT")) {
- timeStr = "PT" + timeStr;
+ // Check if it's a shorthand duration (e.g., "1m", "2h")
+ Duration shorthandDuration = parseShorthandDuration(timeStr);
+ if (shorthandDuration != null) {
+ info.setDuration(shorthandDuration);
+ } else if (!timeStr.startsWith("PT") && !timeStr.startsWith("P")) {
+ // If not already prefixed with P or PT, determine which prefix to use
+ // Check if it contains time components (H, M, S) or date components (Y, W, D)
+ // Note: M is ambiguous (could be months or minutes), so we check for T presence
+ if (timeStr.contains("T") || timeStr.matches(".*[0-9]+[HMS].*")) {
Review Comment:
this is problematic, because editor actually uses **M** for moths and **m** for minutes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org