<?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 How is HistoricProcessInstanceEntity's startUserId set? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225239#M178369</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to understand how this is set when a process instance on all of these scenarios:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;===========================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. By None StartEvent both synchronous and asynchronous&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured from &amp;lt;activiti:initiator&amp;gt; process variable.&amp;nbsp; Is this coming from Spring like example below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;String initiator = SecurityContextHolder.getContext().getAuthentication().getPrincipal();&lt;BR /&gt;&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;BR /&gt;&lt;SPAN&gt;2. By Message start event both synchronous and asynchronous&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. By Signal start event both synchronous and asynchronous&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured I'd back track from the DB entity, to see, but when I do a Eclipse "Call Hierarchy" on HistoricProcessInstanceEntity.setStartUserId(), I get zero hits.&amp;nbsp; How is this field in the DB even populated then?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 May 2016 00:45:56 GMT</pubDate>
    <dc:creator>jwestra</dc:creator>
    <dc:date>2016-05-10T00:45:56Z</dc:date>
    <item>
      <title>How is HistoricProcessInstanceEntity's startUserId set?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225239#M178369</link>
      <description>I am trying to understand how this is set when a process instance on all of these scenarios:===========================================================================1. By None StartEvent both synchronous and asynchronousI figured from &amp;lt;activiti:initiator&amp;gt; process variable.&amp;nbsp; Is this coming fr</description>
      <pubDate>Tue, 10 May 2016 00:45:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225239#M178369</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-05-10T00:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How is HistoricProcessInstanceEntity's startUserId set?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225240#M178370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; public HistoricProcessInstanceEntityImpl(ExecutionEntity processInstance) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = processInstance.getId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; processInstanceId = processInstance.getId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; businessKey = processInstance.getBusinessKey();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; processDefinitionId = processInstance.getProcessDefinitionId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; startTime = Context.getProcessEngineConfiguration().getClock().getCurrentTime();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; startUserId = Authentication.getAuthenticatedUserId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; startActivityId = processInstance.getActivityId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; superProcessInstanceId = processInstance.getSuperExecution() != null ? processInstance.getSuperExecution().getProcessInstanceId() : null;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inherit tenant id (if applicable)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (processInstance.getTenantId() != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tenantId = processInstance.getTenantId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 08:40:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225240#M178370</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-05-10T08:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: How is HistoricProcessInstanceEntity's startUserId set?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225241#M178371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah… I was fooled by that old trick of having a "setter" that is not used because the attribute it directly "set"!&amp;nbsp; Thanks for pointing that out, Martin.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Given that the startUserId comes from Authentication.authenticatedUserIdThreadLocal, I'll record a few thoughts and please correct me if I am wrong on any of them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How HistoricProcessInstance "startUserId" is set:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;============================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. None StartEvent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;synchronous None StartEvent from the authenticated UserId, if any&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;asynchronous - no authenticated UserId exists, so HistoricProcessInstance.startUserId will never be set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Message StartEvent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;synchronous Message StartEvent from the authenticated UserId, if any&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;asynchronous - no authenticated UserId exists, so HistoricProcessInstance.startUserId will never be set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Signal StartEvent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;synchronous Signal StartEvent from the authenticated UserId, if any&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;asynchronous - no authenticated UserId exists, so HistoricProcessInstance.startUserId will never be set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to 'hook' in an Authenticated userid when an Activiti process instance is started asynchronously?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 15:08:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225241#M178371</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-05-10T15:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: How is HistoricProcessInstanceEntity's startUserId set?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225242#M178372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did not try it but let's try to set Authenticated userId before message/signal start event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let's be a way et &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 May 2016 19:36:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-is-historicprocessinstanceentity-s-startuserid-set/m-p/225242#M178372</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2016-05-15T19:36:44Z</dc:date>
    </item>
  </channel>
</rss>

