Skip to end of metadata
Go to start of metadata

Introduction

All classes are in the com.suncode.web.userdeactivation package

Get process and task types from the system

Path to servlet: api/userDeactivation/getProcessTypesForUser

Method: GET

Parameters:

  • userName - user login (mandatory).

Result:

  • The servlet returns a list of objects representing information about processes in JSON format.
  • The structure of the returned objects contains the following fields: 'name','description','packageId','processDefId','children'. The children field contains a list of objects representing process roles. The role object has fields: id, name, it also contains the children field containing the types of tasks from the role. The structure of the task object contains fields:'name','activityDefId','assigned'. The assigned field takes the value true if the user given as a parameter is assigned to at least one task of a given type.
Example result
[
   {
      "name":"procTest1",
      "description":"",
      "packageId":"api",
      "processDefId":"proctest1",
      "children":[
         {
            "name":"Uczestnik 1",
            "id":"uczestnik_1",
            "children":[
               {
                  "name":"Zadanie 1",
                  "activityDefId":"zadanie_1",
                  "assigned":true,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               },
               {
                  "name":"Zadanie 2",
                  "activityDefId":"zadanie_2",
                  "assigned":false,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               }
            ]
         },
         {
            "name":"Uczestnik 2",
            "id":"uczestnik_2",
            "children":[
               {
                  "name":"Zadanie 3",
                  "activityDefId":"zadanie_3",
                  "assigned":false,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               }
            ]
         },
         {
            "name":"",
            "id":"system",
            "children":[
               {
                  "name":"",
                  "activityDefId":"proctest1_act1",
                  "assigned":false,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               }
            ]
         }
      ]
   },
   {
      "name":"procTest2",
      "description":"",
      "packageId":"api",
      "processDefId":"proctest2",
      "children":[
         {
            "name":"Uczestnik 3",
            "id":"uczestnik_3",
            "children":[
               {
                  "name":"Zadanie 1",
                  "activityDefId":"zadanie_1",
                  "assigned":false,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               }
            ]
         }
      ]
   },
   {
      "name":"Proces rejestracji szkolenia",
      "description":"Process rejestracji szkoleń dla pracowników",
      "packageId":"cuf1.1",
      "processDefId":"proces_reje",
      "children":[
         {
            "name":"Uczestnik 1",
            "id":"uczestnik_1332",
            "children":[
               {
                  "name":"Rejestracja szkolenia",
                  "activityDefId":"rejestracja_szkolenia",
                  "assigned":true,
                  "leaf":true,
                  "assignments":null,
                  "group":false
               }
            ]
         }
      ]
   }
]

 

 

User deactivation

Path to servlet: api/userdeactivation/deactivate

Method:  POST

Content-Type: application/json

Parameters:

  • Sending a JSON object with the following fields:
    • userName - login of the user we are deactivating
    • deleagationUser - login of the user who will take over the replacements
    • viewUser - login of the user who will take over the substitutions
    • reportUser - login of the user who will take over substitutions
    • dashboardUser - login of the user who will take over substitutions
    • notifiactionUser - login of the user who will take over the substitutions
    • processes - information about the processes to be redirected to other users


Example query
{
   userName:'admin',
   delegationUser:'aaa',
   viewUser:'aaa',
   reportUser:'aaa',
   dashboardUser:'aaa',
   notificationUser:'aaa',
   processes:[
      {
         "name":"procTest1",
         "description":"",
         "packageId":"api",
         "processDefId":"proctest1",
         "children":[
            {
               "name":"Uczestnik 1",
               "id":"uczestnik_1",
               "children":[
                  {
                     "name":"Zadanie 1",
                     "activityDefId":"zadanie_1",
                     "assigned":true,
                     "leaf":true,
                     "assignments":['user','user2'],
                     "group":false
                  },
                  {
                     "name":"Zadanie 2",
                     "activityDefId":"zadanie_2",
                     "assigned":false,
                     "leaf":true,
                     "assignments":['user','user2'],
                     "group":false
                  }
               ]
            },
            {
               "name":"Uczestnik 2",
               "id":"uczestnik_2",
               "children":[
                  {
                     "name":"Zadanie 3",
                     "activityDefId":"zadanie_3",
                     "assigned":false,
                     "leaf":true,
                     "assignments":['user','user2'],
                     "group":false
                  }
               ]
            },
            {
               "name":"",
               "id":"system",
               "children":[
                  {
                     "name":"",
                     "activityDefId":"proctest1_act1",
                     "assigned":false,
                     "leaf":true,
                     "assignments":['user','user2'],
                     "group":false
                  }
               ]
            }
         ]
      },
      {
         "name":"procTest2",
         "description":"",
         "packageId":"api",
         "processDefId":"proctest2",
         "children":[
            {
               "name":"Uczestnik 3",
               "id":"uczestnik_3",
               "children":[
                  {
                     "name":"Zadanie 1",
                     "activityDefId":"zadanie_1",
                     "assigned":false,
                     "leaf":true,
                     "assignments"::['user','user2'],
                     "group":false
                  }
               ]
            }
         ]
      },
      {
         "name":"Proces rejestracji szkolenia",
         "description":"Process rejestracji szkoleń dla pracowników",
         "packageId":"cuf1.1",
         "processDefId":"proces_reje",
         "children":[
            {
               "name":"Uczestnik 1",
               "id":"uczestnik_1332",
               "children":[
                  {
                     "name":"Rejestracja szkolenia",
                     "activityDefId":"rejestracja_szkolenia",
                     "assigned":true,
                     "leaf":true,
                     "assignments"::['user','user2'],
                     "group":false
                  }
               ]
            }
         ]
      }
   ]
}

Notes

The assignments field in the task cannot be empty.

Result:

  • If the deactivation is successful, the servlet returns a response of the form:

    {success:true}


User deactivation information

Path to servletapi/userdeactivation/deactivate (deprecated) 

 

Path to servletapi/userdeactivation/deactivate/processes

Method: GET

Parameters:

  • userName - user login

Result: 

  • The servlet returns an object like the one sent in the user deactivation method with only the processes field set.

Change of task redirection of deactivated user

Path to servletapi/userdeactivation/deactivate/change

Method: POST

Content-Type: application/json

Parameters:

  • We are sending a JSON object with the following fields:
    • userName - login of the user whose data we are changing,
    • processes - information about the processes to be redirected to other users (analogous to the deactivate method).

Result:

  • If the operation is successful, the servlet returns a response of the form:

    {success:true}

EmptyTaskUser user download

Path to servletapi/userDeactivation/getEmptyTaskUser

MethodGET

Parameters:

  • none

Result:

  • Servlet returns a user object

 

Example answer
{
   "userId":"admin",
   "objectId":1000036,
   "firstName":"Default User",
   "lastName":"",
   "password":"73d7665487f88c55adb98e90a84f579728032f46",
   "email":"",
   "active":false,
   "positions":null,
   "groups":null,
   "fullName":"Default User"
}

  • No labels