<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Assign user Tasks to another (user will be deleted)</title><link>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted</link><description>&lt;p&gt;Good morning,&lt;/p&gt;
&lt;p&gt;Is there a possibility to assign all the tasks owned by a user to another one? In that case the first user.
Thanks a lot in advance&lt;/p&gt;
&lt;p&gt;Emmanuel&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 12 Feb 2016 14:21:42 -0500</lastBuildDate><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted/1656</link><description>&lt;p&gt;Username renaming is not directly possible by an (official) public API, but:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the Security System is connected with an External Security System (i.e. AD), a renaming of the external security name OR the user name is supported. Except, both are changed at the same time. &lt;/li&gt;
&lt;li&gt;If the Security System is not connected to an External Security System, you could rename the user name in the IWA_User system database table (after stopping the Axon.ivy Engine).&lt;/li&gt;
&lt;li&gt;Or, as a workaround, the Interface IUser could be casted to User, and then the method setName(..) is available. But the method has to be executed as system. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Code example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;package wf;

import java.util.concurrent.Callable;

import ch.ivyteam.ivy.security.IUser;
import ch.ivyteam.ivy.security.internal.User;
import ch.ivyteam.ivy.server.ServerFactory;

public final class WorkflowAdminUtil {
    private WorkflowAdminUtil(){}
    public static void setUserName(IUser user, String newUserName) throws Exception {
        ServerFactory.getServer().getSecurityManager().executeAsSystem(
            new Callable&amp;lt;Void&amp;gt;() {
                @Override
                public Void call() throws Exception {
                    ((User) user).setName(newUserName);
                    return null;
                }
        });
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Fri, 12 Feb 2016 14:21:42 -0500</pubDate><guid>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted/1656</guid></item><item><title>Comment by Emmanuel on Emmanuel's question</title><link>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted#1655</link><description>&lt;p&gt;Hallo Flavio, Yes this is the root cause.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Emmanuel</dc:creator><pubDate>Fri, 12 Feb 2016 11:12:49 -0500</pubDate><guid>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted#1655</guid></item><item><title>Comment by Flavio Sadeghi on Emmanuel's question</title><link>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted#1654</link><description>&lt;p&gt;Hello Emmanuel. Is the root use case the renaming of a user name?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Fri, 12 Feb 2016 10:05:33 -0500</pubDate><guid>https://answers.axonivy.com/questions/1653/assign-user-tasks-to-another-user-will-be-deleted#1654</guid></item></channel></rss>