<?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 TaskService.addComment(...) has no argument for the userId in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115127#M81149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're currently integrating Activiti with a spring-based application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We don't use Activiti's IdentityService or the Activiti Explorer at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We tried to add comments to a task but the method "TaskService.addComment(…)" has no argument for the userId.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The userId is retrieved in "org.activiti.engine.impl.cmd.AddCommentCmd" by using&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;String userId = Authentication.getAuthenticatedUserId()&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;As a workaround I could just set the authenticated userId using &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;identityService.setAuthenticatedUserId("johndoe");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; and remove it afterward but this seams not best way to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Beside "TaskService.addComment(…)" the userId is also needed in &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;org.activiti.engine.TaskService.createAttachment(String, String, String, String, String, InputStream)&lt;BR /&gt;org.activiti.engine.TaskService.createAttachment(String, String, String, String, String, String)&lt;SPAN class="line-numbers-rows"&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;In both cases the current userId is needed in "org.activiti.engine.impl.cmd.CreateAttachmentCmd" for creating a comment if the history is enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if this is a bug so I started here instead of creating a Jira, but I think the dependency to the IdentityService should be removed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your feedback on this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2012 13:06:11 GMT</pubDate>
    <dc:creator>mowl</dc:creator>
    <dc:date>2012-05-18T13:06:11Z</dc:date>
    <item>
      <title>TaskService.addComment(...) has no argument for the userId</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115127#M81149</link>
      <description>Hi there,We're currently integrating Activiti with a spring-based application.We don't use Activiti's IdentityService or the Activiti Explorer at all.We tried to add comments to a task but the method "TaskService.addComment(…)" has no argument for the userId.The userId is retrieved in "org.activiti.</description>
      <pubDate>Fri, 18 May 2012 13:06:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115127#M81149</guid>
      <dc:creator>mowl</dc:creator>
      <dc:date>2012-05-18T13:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: TaskService.addComment(...) has no argument for the userId</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115128#M81150</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;SPAN&gt;&amp;nbsp;&amp;nbsp; Is there a solution yet for this problem ?&amp;nbsp; Even I have a requirement which is similar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jun 2013 16:58:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115128#M81150</guid>
      <dc:creator>lvenkat</dc:creator>
      <dc:date>2013-06-03T16:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: TaskService.addComment(...) has no argument for the userId</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115129#M81151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, you should use Authentication.setAuthenticatedUserId() . This method has no dependency on the identity service, so that should work just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 08:31:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/taskservice-addcomment-has-no-argument-for-the-userid/m-p/115129#M81151</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2013-06-04T08:31:14Z</dc:date>
    </item>
  </channel>
</rss>

