/** * parses the duration from a text * * <p>duration = part [',' part | 'and' part]* part = number ['business'] unit number = (0..9)+ * unit = (y|year|years|month|months|w|week|weeks|d|day|days |h|hour|hours|min|minute * |minutes|s|sec|second|seconds|milli|millis|millisecond|milliseconds) * * @throws JbpmException if the parsing is unsuccessful */ public Duration(String text) { if (text == null) throw new RuntimeException("text is null"); for (String part : splitInParts(text)) { parsePart(part); } isBusinessTime = text.indexOf("business") != -1; }