<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Are there any known issues using P1W as a time duration? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20034#M8867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the code I see in the DurationHelper class below:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private Calendar add(Calendar date, Duration duration) {&lt;BR /&gt;Calendar calendar = (Calendar) date.clone();&lt;/P&gt;&lt;P&gt;// duration.addTo does not account for daylight saving time (xerces),&lt;BR /&gt;// reversing order of addition fixes the problem&lt;BR /&gt;calendar.add(Calendar.SECOND, duration.getSeconds() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.MINUTE, duration.getMinutes() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.HOUR, duration.getHours() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.DAY_OF_MONTH, duration.getDays() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.MONTH, duration.getMonths() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.YEAR, duration.getYears() * duration.getSign());&lt;/P&gt;&lt;P&gt;return calendar;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It doesn't appear as though "W" or week is supported.&lt;/P&gt;&lt;P&gt;I have not run a debugger against this to verify, but this would explain your symptoms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 00:53:23 GMT</pubDate>
    <dc:creator>gdharley</dc:creator>
    <dc:date>2017-02-27T00:53:23Z</dc:date>
    <item>
      <title>Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20031#M8864</link>
      <description>We have been using time duration with ISO 8601 durations, but have recently tried testing more variations. &amp;nbsp;Today we received this error, that by the stack trace seems to indicate a problem with resolving the duration, and possibly related to the default business calendar. &amp;nbsp;Is there some configurati</description>
      <pubDate>Fri, 24 Feb 2017 16:38:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20031#M8864</guid>
      <dc:creator>kch0313</dc:creator>
      <dc:date>2017-02-24T16:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20032#M8865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not that I am aware of, but I'll check and follow up with you.&lt;/P&gt;&lt;P&gt;If you could provide any other related information, that would be awesome. Particularly a snippet of the code that triggers this stack trace.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;-JEarles&lt;BR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 23:05:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20032#M8865</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-24T23:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20033#M8866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added attachments to my original post, one with the BPMN model you can import and execute. &amp;nbsp;Basically, it sets a process variable, and the wait intermediate timer activity uses the variable in a JUEL expression in the duration. &amp;nbsp;Doing this with other ISO 8601 durations worked, but P1W didn't. &amp;nbsp;I used Activiti Explorer to import this model, deploy, and start an instance to generate the error. &amp;nbsp;The other attachment added to my original post is the log snippet from Tomcat showing the error reported in Activiti Explorer with errors similar to my original stack trace (with a fragment below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Caused by: org.activiti.engine.ActivitiException: couldn't resolve duedate: P1W&lt;BR /&gt; at org.activiti.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:37)&lt;BR /&gt; at org.activiti.engine.impl.calendar.BusinessCalendarImpl.resolveDuedate(BusinessCalendarImpl.java:22)&lt;BR /&gt; at org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl.prepareTimerEntity(TimerDeclarationImpl.java:165)&lt;BR /&gt; at org.activiti.engine.impl.persistence.entity.ExecutionEntity.initialize(ExecutionEntity.java:351)&lt;BR /&gt; at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:43)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)&lt;/P&gt;&lt;P&gt;... ommitted for brevity&lt;/P&gt;&lt;P&gt;Caused by: java.lang.IllegalArgumentException: P1W&lt;BR /&gt; at com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl.organizeParts(DurationImpl.java:612)&lt;BR /&gt; at com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl.&amp;lt;init&amp;gt;(DurationImpl.java:524)&lt;BR /&gt; at com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl.newDuration(DatatypeFactoryImpl.java:104)&lt;BR /&gt; at org.activiti.engine.impl.calendar.DurationHelper.parsePeriod(DurationHelper.java:169)&lt;BR /&gt; at org.activiti.engine.impl.calendar.DurationHelper.&amp;lt;init&amp;gt;(DurationHelper.java:89)&lt;BR /&gt; at org.activiti.engine.impl.calendar.DurationHelper.&amp;lt;init&amp;gt;(DurationHelper.java:107)&lt;BR /&gt; at org.activiti.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:34)&lt;BR /&gt; ... 138 more&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 23:30:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20033#M8866</guid>
      <dc:creator>kch0313</dc:creator>
      <dc:date>2017-02-26T23:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20034#M8867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on the code I see in the DurationHelper class below:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private Calendar add(Calendar date, Duration duration) {&lt;BR /&gt;Calendar calendar = (Calendar) date.clone();&lt;/P&gt;&lt;P&gt;// duration.addTo does not account for daylight saving time (xerces),&lt;BR /&gt;// reversing order of addition fixes the problem&lt;BR /&gt;calendar.add(Calendar.SECOND, duration.getSeconds() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.MINUTE, duration.getMinutes() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.HOUR, duration.getHours() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.DAY_OF_MONTH, duration.getDays() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.MONTH, duration.getMonths() * duration.getSign());&lt;BR /&gt;calendar.add(Calendar.YEAR, duration.getYears() * duration.getSign());&lt;/P&gt;&lt;P&gt;return calendar;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It doesn't appear as though "W" or week is supported.&lt;/P&gt;&lt;P&gt;I have not run a debugger against this to verify, but this would explain your symptoms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 00:53:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20034#M8867</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-02-27T00:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20035#M8868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a little bit more context on this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that creates the DueDate based on what is entered in the model editor uses the DatatypeFactory API, calling the method: &lt;SPAN class="" style="color: #353833; background-color: #eeeeef; font-weight: bold;"&gt;&lt;A href="https://docs.oracle.com/javase/8/docs/api/javax/xml/datatype/DatatypeFactory.html#newDuration-java.lang.String-" style="color: #4a6782; font-weight: bold; padding-bottom: 3px;" rel="nofollow noopener noreferrer"&gt;newDuration&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #353833; background-color: #eeeeef;"&gt;(&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" style="color: #4a6782; background-color: #eeeeef; font-weight: bold; padding-bottom: 3px;" title="class in java.lang" rel="nofollow noopener noreferrer"&gt;String&lt;/A&gt;&lt;SPAN style="color: #353833; background-color: #eeeeef;"&gt;&amp;nbsp;lexicalRepresentation)&lt;/SPAN&gt;&amp;nbsp;- which creates the calendar object based on the string format&amp;nbsp;"PnYnMnDTnHnMnS", which does not include weeks (as defined in the &lt;A href="https://www.w3.org/TR/2000/CR-xmlschema-2-20001024/" rel="nofollow noopener noreferrer"&gt;XML Schema 1.0 Section 3.2.6.1&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the behavior you're seeing is expected and caused by the libraries being used.&lt;BR /&gt;&lt;BR /&gt;-JEarles&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 18:08:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20035#M8868</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-27T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any known issues using P1W as a time duration?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20036#M8869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the obvious work-around for this is to use 7 days (P7D), which for most is an equivalent operation.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;thanks both for your immediate attention and helpful information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 04:11:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/are-there-any-known-issues-using-p1w-as-a-time-duration/m-p/20036#M8869</guid>
      <dc:creator>kch0313</dc:creator>
      <dc:date>2017-02-28T04:11:26Z</dc:date>
    </item>
  </channel>
</rss>

