Good morning,

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

Emmanuel

asked 12.02.2016 at 09:16

Emmanuel's gravatar image

Emmanuel
(suspended)
accept rate: 66%

Hello Emmanuel. Is the root use case the renaming of a user name?

(12.02.2016 at 10:05) Flavio Sadeghi ♦♦ Flavio%20Sadeghi's gravatar image

Hallo Flavio, Yes this is the root cause.

(12.02.2016 at 11:12) Emmanuel Emmanuel's gravatar image

Username renaming is not directly possible by an (official) public API, but:

  • 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.
  • 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).
  • 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.

Code example:

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<Void>() {
                @Override
                public Void call() throws Exception {
                    ((User) user).setName(newUserName);
                    return null;
                }
        });
    }
}
link

answered 12.02.2016 at 14:21

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
(suspended)
accept rate: 75%

edited 12.02.2016 at 14:23

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26
×13

Asked: 12.02.2016 at 09:16

Seen: 2,472 times

Last updated: 12.02.2016 at 14:23