<?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 TimerBoundaryEvent - Not recognizing Spring Bean in Loop in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48178#M27491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a tricky problem that I've been trying to solve all day, and can't seem to figure out.&amp;nbsp; Hoping you can help…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a TimerBoundaryEvent placed on a Java Receive Task in my process flow.&amp;nbsp; The flow itself is somewhat of a loop.&amp;nbsp; The way that my process flow works is as follows: (simplified for forum purposes):&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;1. Start Task&lt;BR /&gt;2. Service Task (invokes Spring Bean "myAdapter.doSomething()" in an expression)&lt;BR /&gt;3. XOR Gateway (checks whether we have what we need.&amp;nbsp; If not, continues to java receive task.&amp;nbsp; If so, goes to the End Task)&lt;BR /&gt;4. Java Receive Task (waits indefinitely, until interrupted by Timer Boundary Event)&lt;BR /&gt;5. Timer Boundary Event (interrupts Java Receive Task)&lt;BR /&gt;6. XOR Gateway (Determine whether we've reached a maximum number of loops. If not, continue back up to the Service Task in step #2.&amp;nbsp; If so, goes to the End Task)&lt;BR /&gt;7. End Task&lt;/UL&gt;&lt;SPAN&gt;The problem that I'm having is that sometimes when looping back to the service task, the Job fails because it doesn't recognize "myAdapter" (my Spring bean).&amp;nbsp; Note that this is &amp;lt;i&amp;gt;very&amp;lt;/i&amp;gt; inconsistent.&amp;nbsp; From execution to execution, it might change.&amp;nbsp; On one execution, it will recognize the adapter the first time it enters the service (before looping the first time) and then will fail on the second loop.&amp;nbsp; The next time I run my unit test, it will succeed on the first and second loop, but fail on the third loop, etc.&amp;nbsp; I have not yet seen it get to a fourth loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error that I receive is a standard one I'd expect to see when not properly specifying the bean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'myAdapter'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But note that this error DOES NOT OCCUR the first time I enter the Service Task wherein "myAdapter.doSomething()" is invoked … only on subsequent calls after looping back to that Service Task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was thinking that it had something to do with the loop itself … maybe looping back to a task that has already been created, used, and completed is not allowed?&amp;nbsp; Maybe I should pull the "looping" out into it's own Spring Bean, use my own threading/executor, and not use the TimerBoundaryEvent at all?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice or comments would be very much appreciated.&amp;nbsp; I can provide more information on this issue if needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jun 2011 01:44:53 GMT</pubDate>
    <dc:creator>tidetom</dc:creator>
    <dc:date>2011-06-03T01:44:53Z</dc:date>
    <item>
      <title>TimerBoundaryEvent - Not recognizing Spring Bean in Loop</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48178#M27491</link>
      <description>Hi all,I have a tricky problem that I've been trying to solve all day, and can't seem to figure out.&amp;nbsp; Hoping you can help…I have a TimerBoundaryEvent placed on a Java Receive Task in my process flow.&amp;nbsp; The flow itself is somewhat of a loop.&amp;nbsp; The way that my process flow works is as follows: (simplifi</description>
      <pubDate>Fri, 03 Jun 2011 01:44:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48178#M27491</guid>
      <dc:creator>tidetom</dc:creator>
      <dc:date>2011-06-03T01:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: TimerBoundaryEvent - Not recognizing Spring Bean in Loop</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48179#M27492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The bean you are referring to, is this a Session-scoped bean or just a regular one? Perhaps something to do with the fact the job's are executed in another thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you create a simple test-case with a process that shows the bug you are describing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 08:20:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48179#M27492</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-06T08:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: TimerBoundaryEvent - Not recognizing Spring Bean in Loop</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48180#M27493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Frederik,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for getting back…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The bean you are referring to, is this a Session-scoped bean or just a regular one?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;This is just a standard Spring bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Perhaps something to do with the fact the job's are executed in another thread.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yeah, I was kind of thinking the same thing.&amp;nbsp; It's almost like the reference to the Spring context is getting put up for garbage collection on the original thread, given the inconsistency across executions.&amp;nbsp; If the original context was tied to the process execution prior to the job, then if that process execution goes away, the context would, potentially, do the same?&amp;nbsp; But then I suppose this would likely be seen in other scenarios that didn't involve looping.&amp;nbsp; Hmmm….&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can you create a simple test-case with a process that shows the bug you are describing?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;No problem, I'll put something together and reply to this post with the sample.&amp;nbsp; It would probably be good for me to dial down my process into the essential elements causing this anyways.&amp;nbsp; I'll post back soon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 01:30:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/timerboundaryevent-not-recognizing-spring-bean-in-loop/m-p/48180#M27493</guid>
      <dc:creator>tidetom</dc:creator>
      <dc:date>2011-06-07T01:30:52Z</dc:date>
    </item>
  </channel>
</rss>

