<?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 Changing userId (username) by code in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/changing-userid-username-by-code/m-p/41538#M17421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm interacting with Activiti by using the Activiti Engine 5.20 API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to change the userID (and the groupId) through indentyService?&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;EM&gt; IdentityService identityService = processEngine.getIdentityService();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;org.activiti.engine.identity.User identiUser = identityService.createUserQuery().userId("kermit").singleResult();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;identiUser.setId("pipponzo");&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;identityService.saveUser(identiUser);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It throws&lt;/P&gt;&lt;P&gt;&lt;EM&gt;org.activiti.engine.ActivitiOptimisticLockingException: org.activiti.engine.impl.persistence.entity.UserEntity@650ae78c was updated by another transaction concurrently&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:880)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:619)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at org.activiti.engine.impl.IdentityServiceImpl.saveUser(IdentityServiceImpl.java:65)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at com.jnsw.gesdoc.test.ActivitiUnitTest.updateUserID(ActivitiUnitTest.java:200)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I think we cannot change userId because it is a key and it cannot retrieve anylong identiUser beacause we've changed the id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Apr 2017 09:08:22 GMT</pubDate>
    <dc:creator>bubu</dc:creator>
    <dc:date>2017-04-07T09:08:22Z</dc:date>
    <item>
      <title>Changing userId (username) by code</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/changing-userid-username-by-code/m-p/41538#M17421</link>
      <description>Hi all, I'm interacting with Activiti by using the Activiti Engine 5.20 API.Is it possible to change the userID (and the groupId) through indentyService?&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IdentityService identityService = processEngine.getIdentityService();&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;org.activiti.engine.identity.User identiUser = identityService</description>
      <pubDate>Fri, 07 Apr 2017 09:08:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/changing-userid-username-by-code/m-p/41538#M17421</guid>
      <dc:creator>bubu</dc:creator>
      <dc:date>2017-04-07T09:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing userId (username) by code</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/changing-userid-username-by-code/m-p/41539#M17422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefano,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My results are consistent with yours; I'm not sure if there is a workaround for this.&lt;BR /&gt;In all cases that I've found or that have worked for me, the 'setId' method is only usable for&amp;nbsp;preemptive setting of a user's ID value - not changing it after it's been saved already.&lt;BR /&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>Tue, 11 Apr 2017 16:45:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/changing-userid-username-by-code/m-p/41539#M17422</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-04-11T16:45:54Z</dc:date>
    </item>
  </channel>
</rss>

