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?
IdentityService identityService = processEngine.getIdentityService();
org.activiti.engine.identity.User identiUser = identityService.createUserQuery().userId("kermit").singleResult();
identiUser.setId("pipponzo");
identityService.saveUser(identiUser);
It throws
org.activiti.engine.ActivitiOptimisticLockingException: org.activiti.engine.impl.persistence.entity.UserEntity@650ae78c was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:880)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:619)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.IdentityServiceImpl.saveUser(IdentityServiceImpl.java:65)
at com.jnsw.gesdoc.test.ActivitiUnitTest.updateUserID(ActivitiUnitTest.java:200)
(I think we cannot change userId because it is a key and it cannot retrieve anylong identiUser beacause we've changed the id)
Thanks in advance.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.