Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Polish

Tworzenie procesu

Opis: Tworzy proces jako zalogowany użytkownik

Ścieżka do servletu: api/processes/create

Metoda: POST

Request Content-Typeapplication/json

Treść zapytania:

 Obiekt JSON zawierający parametry akceptacji. Definicja powinna zawierać następujące pole:

    • packageId - Id pakietu
    • processDefId - Id definicji procesu
    • variables - Mapa wartości zmiennych w której klucz to id zmiennej.

 

Code Block
languagejs
titlePrzykładowa treść zapytania
{
	"packageId" : "pakiet_testowy",
	"processDefId" : "proces_testowy",
	"variables" : {
		"zmienna_calkowita" : 99,
		"zmienna_tekst" : "tekst",
		"zmienna_data" : "2021-10-11",
		"zmienna_kwota" : 2.23,
		"zmienna_zmiennoprzecinkowa" : 1.90,
		"zmienna_logiczna" : true,
		"zmienna_pole_tekstowe" : "pole tekstowe",
		"zmienna_uzytkownik_systemu" : "admin",
		"zmienna_tablica_uzytkownikow_systemu" : "anowak",
		"zmienna_dataczas" : "2021-12-26 09:15:23"
	}
}
Note

Zmienna typu data musi zostać przekazana jako ciąg znaków w formacie "yyyy-MM-dd" a zmienna typu data i czas w formacie "yyyy-MM-dd HH:mm:ss". Niestandardowe zmienne jak Lista użytkowników systemu, Tabela użytkowników systemu itp przekazane powinny być jako tekst (w tym przypadku jest to login użytkownika).

Code Block
languagejavascript
titlePrzykładowa odpowiedź
linenumberstrue
//Jeżeli po utworzeniu procesu nie istnieje otwarte zadanie dla zalogowanego użytkownika
{"processId":"3911_suncode_api_proctest1","activityId":null,"hasOpenActivity":false}
 
//Jeżeli po utworzeniu procesu istnieje otwarte zadanie dla zalogowanego użytkownika
{"processId":"3912_suncode_api_proctest2","activityId":"4512_3912_suncode_api_proctest2_zadanie_1","hasOpenActivity":true}

 

Pobieranie dostępnych typów procesów dla użytkownika

Opis: Pobiera listę dostępnych typów procesów dla zalogowanego użytkownika

Ścieżka do servletu: api/processes/types

Metoda: GET

Treść zapytania:

 Brak parametrów

Odpowiedź:

Lista typów procesów

Code Block
languagejavascript
titlePrzykładowa odpowiedź
linenumberstrue
[  
   {  
      "name":"Proces 1",
      "description":"",
      "packageId":"simple",
      "processDefId":"proces_1"
   },
   {  
      "name":"Zmiana użytkownika zadania",
      "description":"Zamiana użytkownika przypisanego do zadania",
      "packageId":"change_user",
      "processDefId":"zmiana_uzytkownika"
   }
]

 

Pobieranie informacji o zadaniach dla danego identyfikatora definicji procesu

Opis: Pobiera informacje o zadaniach dla danego identyfikatora definicji procesu

Ścieżka do servletu: api/processes/definition/{processDefinitionId}/activities

Metoda: GET

Parametry (przekazywane w ścieżce servletu):

  • processDefinitionId - id definicji procesu, z którego ma pobrać informacje o zadaniach

Odpowiedź:

Lista zadań (definicja oraz nazwa) z najnowszego pakietu

Code Block
languagejavascript
titlePrzykładowa odpowiedź
linenumberstrue
[  
   {  
	  "activityDefinitionId": "zadanie_1",
      "activityName": "Zadanie 1"
   },
   {  
      "activityDefinitionId": "zmiana_uzytkownika",
      "activityName": "Zmiana użytkownika zadania"
   }
]

 

English

Create process

Description: Creates a process as a logged in user

Path to servlet: api/processes/create

Method: POST

Request Content-Typeapplication/json

Query Content:

 JSON object containing acceptance parameters. The definition should contain the following field:

    • packageId - package Id
    • processDefId - process definition Id
    • variables - A map of variable values in which the key is the id of the variable.

 

Code Block
languagejs
titleExample content of the request
{
	"packageId" : "test package",
	"processDefId" : "test_package",
	"variables" : {
		"variable_integer" : 99,
		"variable_text" : "text",
		"variable_date" : "2021-10-11",
		"variable_amount" : 2.23,
		"variable_float" : 1.90,
		"variable_bloolean" : true,
		"variable_textfield" : "text box",
		"variable_user_system" : "admin",
		"variable_user_system_table" : "anowak",
		"variable_date-time" : "2021-12-26 09:15:23"
	}
}
Note

The date type variable must be passed as a string in the format "yyyy-MM-dd" and the date and time type variable in the format "yyyy-MM-dd HH:mm:ss". Custom variables like List of system users, Table of system users, etc. should be passed as text (in this case, it is user login).

Code Block
titleExample answer
linenumberstrue
//If there is no open task for the logged-in user after the process is created
{"processId":"3911_suncode_api_proctest1","activityId":null,"hasOpenActivity":false}
 
//If there is an open task for a logged-in user after the process is created
{"processId":"3912_suncode_api_proctest2","activityId":"4512_3912_suncode_api_proctest2_zadanie_1","hasOpenActivity":true}

 

Get available process types for a user

Description: Get the list of available process types for the logged in user

Path to servlet: api/processes/types

Method: GET

Query Content:

 No parameters

Answer:

List of process types

Code Block
titleExample answer
linenumberstrue
[  
   {  
      "name":"Proces 1",
      "description":"",
      "packageId":"simple",
      "processDefId":"proces_1"
   },
   {  
      "name":"Change of task user",
      "description":"Replacing the user assigned to a task",
      "packageId":"change_user",
      "processDefId":"zmiana_uzytkownika"
   }
]

 

Get task information for a given process definition identifier

Description: Retrieves task information for a given process definition Id

Path to servlet: api/processes/definition/{processDefinitionId}/activities

Method: GET

Parameters (passed in servlet path):

  • processDefinitionId - id of the process definition from which to retrieve task information

Answer:

List of tasks (definition and name) from the latest package

Code Block
titleExample answer
linenumberstrue
[  
   {  
	  "activityDefinitionId": "task_1",
      "activityName": "Task 1"
   },
   {  
      "activityDefinitionId": "user_change",
      "activityName": "Change of task user"
   }
]