<?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: HistoricProcessInstance.getStartUserId() return null in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78701#M52256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) yup exactly the same. My bad for using the wrong method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) And I indeed meant Filter, not listener !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Apr 2011 07:09:01 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2011-04-22T07:09:01Z</dc:date>
    <item>
      <title>HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78694#M52249</link>
      <description>Hi there,When I call historyService.createHistoricProcessInstanceQuery().list() the process instance 'getStartUserId()' for each resulting instance always returns a null. I re-post the statement here which originated from Grails Activiti Plugin user, Ned.I know the reason why it return null, this is</description>
      <pubDate>Tue, 19 Apr 2011 02:23:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78694#M52249</guid>
      <dc:creator>limcheekin</dc:creator>
      <dc:date>2011-04-19T02:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78695#M52250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The current logged-in user should be set using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;org.activiti.engine.impl.identity.Authentication.setAuthenticatedUser(…);&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Best to clear the authenticated user after your requests to the engine have finished (authentication is thread-local)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 08:45:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78695#M52250</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-04-19T08:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78696#M52251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for quick response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you means this API method?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.activiti.org/javadocs/org/activiti/engine/IdentityService.html#setAuthenticatedUserId%28java.lang.String%29" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/javadocs/org/activiti/engine/IdentityService.html#setAuthenticatedUserId%28java.lang.String%29&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you defined the "finished" state? Is the process instance started then considered finished? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How to clear it by the way? setAuthenticatedUserId(null)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chee Kin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 09:45:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78696#M52251</guid>
      <dc:creator>limcheekin</dc:creator>
      <dc:date>2011-04-19T09:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78697#M52252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is how we currently do it in the webapp: when a new request comes in, we set the authenticated user. When all is done, and the response is sent back, we set null.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 08:08:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78697#M52252</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-04-20T08:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78698#M52253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This is how we currently do it in the webapp: when a new request comes in, we set the authenticated user. When all is done, and the response is sent back, we set null.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for writing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still not sure when should I set the authenticated user and when to clear it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you elaborate more about "When all is done", how do the request considered "done", do you means on user task basis? The application need to set the authenticated user before the user task started and clear it after the user task completed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will be very much appreciated if you can elaborate more about your webapp scenario.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chee Kin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 08:30:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78698#M52253</guid>
      <dc:creator>limcheekin</dc:creator>
      <dc:date>2011-04-20T08:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78699#M52254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sure: in a regular webapp, the best way would be using a Servlet Listener that catches all incoming requests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When a request is receivd, the authenticated user is set, then the next request handler in the chain is called. When that method returns, the authenticated user is removed again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is how we do it in our Vaadin app:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Authentication: check if user is found, otherwise send to login page&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoggedInUser user = (LoggedInUser) getUser();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (user == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set thread-local userid of logged in user (needed for Activiti user logic)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authentication.setAuthenticatedUserId(user.getId());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; public void onRequestEnd(HttpServletRequest request, HttpServletResponse response) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authentication.setAuthenticatedUserId(null);&lt;BR /&gt;&amp;nbsp; }&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 08:10:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78699#M52254</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-04-21T08:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78700#M52255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for "show me the code". &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; I am clearer now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I have two more questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is IdentityService.setAuthenticatedUserId() same with Authentication.setAuthenticatedUserId()?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) What if I implement it using Servlet Filter? Just curious why do you choose Servlet Listener over Servlet Filter?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wish to hear from you again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chee Kin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 11:39:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78700#M52255</guid>
      <dc:creator>limcheekin</dc:creator>
      <dc:date>2011-04-21T11:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78701#M52256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) yup exactly the same. My bad for using the wrong method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) And I indeed meant Filter, not listener !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 07:09:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78701#M52256</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-04-22T07:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: HistoricProcessInstance.getStartUserId() return null</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78702#M52257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;1) yup exactly the same. My bad for using the wrong method.&lt;BR /&gt;2) And I indeed meant Filter, not listener !&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for further clarification and confirmation. I implemented this servlet filter in Activiti Spring Security Integration plugin 0.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chee Kin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 07:26:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/historicprocessinstance-getstartuserid-return-null/m-p/78702#M52257</guid>
      <dc:creator>limcheekin</dc:creator>
      <dc:date>2011-04-22T07:26:18Z</dc:date>
    </item>
  </channel>
</rss>

