IntroductionDeactivation allows, first of all, to rewrite all current and possible future tasks of a user to other selected users in the system. In addition, the user's substitutions, views, reports and notifications are rewritten. Removal of a user from the system must always be preceded by deactivation. The API for deactivating a user is provided by the service . Available methods Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| /**
* Deactivates the user. All views, overrides, notifications, reports and open tasks and possible
* future tasks of the user will be rewritten to admin.
*
* @param userName User login
* @author Paweł Rosolak 16 paź 2013
*/
void deactivateUser( String userName );
/**
* Deactivates the user
*
* @param deactivation An object containing all the information necessary to deactivate a user.
* @author Rafał Nowacki 05-12-2014
*/
void deactivateUser( Deactivation deactivation ); |
The first method performs deactivation and by default everything is passed to the user with the login 'admin'. The second method allows you to configure all assignments using the object Deactivation obcjectCreation of the object is done as follows: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| Deactivation deactivation = Deactivation.create( userNameToDeactivate ); |
The created object has the following information completed: user deactivated: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| User userToDeactivate = deactivation.getUser(); |
A list of all processes, roles and tasks in a tree format: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| List<DeactivationProcess> processes = deactivation.getProcesses();
for(DeactivationProcess process : processes)
{
List<DeactivationParticipant> participants = process.getParticipants();
for ( DeactivationParticipant participant : participants )
{
List<DeactivationActivity> activities = participant.getActivities();
}
} |
A list of default users, taken from the configuration file from the EmptyTaskUserName parameter. These users are used to assign tasks that do not have specific assignments: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| List<User> defaultUsers = deactivation.getDefaultUsers(); |
Having a deactivation object, the following parameters should be set in it: Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| //Sets the user to whom substitutions will be prescribed.
deactivation.setSubstitutionUser( substitutionUser );
//Sets the user to whom the views will be rewritten.
deactivation.setViewUser( viewUser );
//Sets the user to whom the reports will be rewritten.
deactivation.setReportUser( reportUser );
//Sets the user to whom notifications will be rewritten.
deactivation.setNotificationUser( notificationUser ); |
The last thing to do is to specify to which users existing user task instances and possible future tasks should go. For existing task instances, it is required to set assignments for these task definitions. Other tasks do not need to be assigned. In this case, the default users defined in the configuration file from the EmptyTaskUserName parameter will be assigned to them. Assignment of tasks can be done from the following levels: deactivation object - assignments will be set for all tasks, process level - assignments will be set for all tasks from the process, role level - assignments will be set for all tasks from a role, task level - assignments will be set only for this task.
You can assign tasks to both individual users and groups of users. Code Block |
---|
language | java |
---|
theme | Eclipse |
---|
title | Example of task assignment |
---|
linenumbers | true |
---|
| //przypisanieassign użytkownikówusers doto wszystkichall zadańtasks
deactivation.setUsers( users );
//przypisanieassign grupgroups użytkownikówto doall wszystkichtasks
zadań
deactivation.setGroups( groups );
List<DeactivationProcess> processes = deactivation.getProcesses();
for(DeactivationProcess process : processes)
{
//przypisanieassign użytkownikówusers doto wszystkichall zadańtasks zfrom procesuthe process
process.setUsers( users );
//przypisanieassign grupuser użytkownikówgroups doto wszystkichall zadańtasks zfrom procesuthe process
process.setGroups( groups );
List<DeactivationParticipant> participants = process.getParticipants();
for ( DeactivationParticipant participant : participants )
{
//przypisanieassign użytkownikówusers doto wszystkichall zadańtasks zfrom rolithe role
participant.setUsers( users );
//przypisanieassign grupuser użytkownikówgroups doto wszystkichall zadańtasks zfrom rolithe role
participant.setGroups( groups );
List<DeactivationActivity> activities = participant.getActivities();
for( DeactivationActivity activity : activities )
{
if( activity.isAssigned() == true )
{
//obowiązkowo należy przypisać użytkownika, bądź grupę użytkowników do tego zadania
}
//przypisanieassigning użytkownikówusers doto zadaniaa task
activity.setUsers( users );
//przypisanieassign grupuser użytkownikówgroups doto zadaniathe task
activity.setGroups( groups );
//zfrom poziomuthe zadaniatask możnalevel, równieżyou dodawaćcan użytkownika,also bądźadd grupęa pojedynczo
user or group individually
activity.addUser( user );
activity.addGroup( group );
}
}
} |
Walidacja- dezaktywowany użytkownik musi istnieć,
- dezaktywowany użytkownik musi być aktywny (czyli nie może być już wcześniej zdezaktywowany),
- użytkownik, któremu zostaną przypisane zastępstwa musi być ustawiony oraz nie może być nim użytkownik, którego dotyczy dezaktywacja,
- użytkownik, któremu zostaną przypisane widoki musi być ustawiony oraz nie może być nim użytkownik, którego dotyczy dezaktywacja,
- użytkownik, któremu zostaną przypisane raporty musi być ustawiony oraz nie może być nim użytkownik, którego dotyczy dezaktywacja,
- użytkownik, któremu zostaną przypisane powiadomienia musi być ustawiony oraz nie może być nim użytkownik, którego dotyczy dezaktywacja,
- zadania, których instancje posiada dezaktywowany użytkownik, muszą mieć przypisanych użytkowników lub grupy, w przypadku przypisania użytkownika dezaktywowanego, nie jest on brany pod uwagę.
Operacje wykonywane podczas dezaktywacji użytkownikazapisanie przekierowań zadań z użytkownika dezaktywowanego do innych użytkowników, bądź grup, w przypadku możliwych przyszłych zadań, które mogłyby trafić do już zdezaktywowanego użytkownika,przepisanie instancji zadań zdezaktywowanego użytkownika do zdefiniowanych użytkowników,zastępstwom, w których dezaktywowany użytkownik jest zastępcą zostaje zmieniony zastępca na zdefiniowanego użytkownika,zastępstwa, w których dezaktywowany użytkownik jest zastępowanym zostają usunięte,widoki zdezaktywowanego użytkownika zostają przepisane do zdefiniowanego użytkownika,udostępnienia widoków zdezaktywowanemu użytkownikowi zostają usunięte,raporty zdezaktywowanego użytkownika zostają przepisane do zdefiniowanego użytkownika,udostępnienia raportów zdezaktywowanemu użytkownikowi zostają usunięte,powiadomienia zdezaktywowanego użytkownika zostają przepisane do zdefiniowanego użytkownika, odłączenie zdezaktywowanego użytkownika od stanowisk,udostępnienia kalendarza zdezaktywowanemu użytkownikowi zostają usunięte,uprawnienia nadane zdezaktywowanemu użytkownikowi zostają usunięte,ustawienia konta zdezaktywowanego użytkownika zostają usunięte,zdefiniowany widok dokumentów użytkownika zostaje usunięty,usunięcie zdezaktywowanego użytkownika ze wszystkich grup,ustawienia użytkownika jako nieaktywnegoValidationthe deactivated user must exist, the deactivated user must be active (i.e., it cannot have been deactivated before), the user to whom substitutions will be assigned must be set and must not be the deactivated user, the user to whom the views will be assigned must be set up and must not be the user to whom the deactivation applies, the user to whom reports will be assigned must be set and must not be the user affected by the deactivation, the user to whom notifications will be assigned must be set and must not be the user affected by the deactivation, tasks whose instances are held by a deactivated user must have users or groups assigned to them, if a deactivated user is assigned, it is not taken into account.
saving task redirections from a deactivated user to other users, or groups, for possible future tasks that could go to an already deactivated user, rewriting task instances of the deactivated user to defined users, substitutions in which the deactivated user is a substitute are changed to the defined user, substitutions in which the deactivated user is a substitute are deleted, views of the deactivated user are rewritten to the defined user, view shares of the deactivated user are deleted, reports of the deactivated user are rewritten to the defined user, report releases to the deactivated user are deleted, notifications of the deactivated user are rewritten to the defined user, disconnection of deactivated user from jobs, calendar accesses to the deactivated user are deleted, permissions granted to the deactivated user are deleted, account settings of the deactivated user are deleted, the user's defined document view is deleted, deleting the deactivated user from all groups, setting the user as inactive.
|