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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]