- Created by Paweł Rosolak, last modified by Joanna Jankowiak on Jul 05, 2023
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 11 Current »
Downloading form definitions
Path to servlet: api/form
Method: GET
Parameters:
- processId- process Id
- activityId - task Id
Answer:
- The answer contains a form definition object.
{ "activityDefinition":{ //task definition "activityDefId":"zadanie_1", "activityName":"Zadanie 1", "description":"opis" }, "autoUpdates":[ //auto update definition { "actionSource":"tata", "dataSource":[ "zmienna1", "zmienna2" ], "destination":[ "zmienna3" ], "taskName":"AutoUpdateTest.customServlet", "eventType":"change" } ], "processDefinition":{ // "packageId":"suncode_api", "processDefinitionId":"zapisformularza" }, "elements":[ { "type":"GRID", "formField":null, "formGrid":{ "title":"Tyuł tabeli", "readOnly":false, "fields":[ { "required":false, "readOnly":false, "hidden":false, "type":"TextField", "variableId":"t1", "variableName":"Zmienna tabelaryczna 1" }, { "required":false, "readOnly":false, "hidden":false, "type":"TextField", "variableId":"t2", "variableName":"Zmienna tabelaryczna 2" }, { "required":true, "readOnly":false, "hidden":false, "type":"DecimalField", "variableId":"liczba", "variableName":"liczba", "format":"0,000.00" } ], "gridEvents":[ //table events { "eventType":"viewready", "functionName":"CUF_testSort" } ], "storeEvents":[ //store events { "eventType":"load", "functionName":"custom_afterLoad" } ], "selectionEvents":[ //mark events { "eventType":"change", "functionName":"custom_selchange" } ] }, "position":0 }, { "type":"FIELD", "formField":{ "required":true, "readOnly":false, "hidden":false, "type":"TextField", "variableId":"tata", "variableName":"tata" }, "formGrid":null, "position":1 }, { // combobox user list as system DataChooser "type": "FIELD", "formField": { "required": false, "readOnly": false, "hidden": false, "type": "DataChooser", "variableId": "userlist1", "variableName": "User List 1", "className": "com.plusmpm.util.workflowData.GetFormValues", "criteria": ["GetDataChooserContentServlet_parameter_query"], "mappings": [ { "dcVarId": "FIELD_DATA_LAST_NAME", "formVarId": "", "name": "Nazwisko" }, { "dcVarId": "FIELD_DATA_FIRST_NAME", "formVarId": "", "name": "Imię" }, { "dcVarId": "FIELD_DATA_USER_ID", "formVarId": "userlist1", "name": "" }], "customKeys": { "sVariableExtendedAttributeValue": "USERLIST", "sActivityId": "1101_1101_pakiet_testowy_jan_zadanie_1", "sWorkflowVariableId": "userlist1", "sProcessId": "1101_pakiet_testowy_jan", "type": "combobox", "sWorkflowVariableValue": "t16", "sUserName": "admin", "sActivityExtendedAttributeValue": "userlist1" } }, "formGrid": null, "position": 2 }, { // user table window as system DataChooser "type": "FIELD", "formField": { "required": false, "readOnly": false, "hidden": false, "type": "DataChooser", "variableId": "userlist2", "variableName": "User List 2", "className": "com.plusmpm.util.workflowData.GetFormValues", "criteria": ["GetDataChooserContentServlet_parameter_query"], "mappings": [ { "dcVarId": "FIELD_DATA_LAST_NAME", "formVarId": "", "name": "Nazwisko" }, { "dcVarId": "FIELD_DATA_FIRST_NAME", "formVarId": "", "name": "Imię" }, { "dcVarId": "FIELD_DATA_USER_ID", "formVarId": "userlist2", "name": "" }], "customKeys": { "sVariableExtendedAttributeValue": "USERLIST", "sActivityId": "1101_1101_pakiet_testowy_jan_zadanie_1", "sWorkflowVariableId": "userlist2", "sProcessId": "1101_pakiet_testowy_jan", "type": "window", "sWorkflowVariableValue": "t14", "sUserName": "admin", "sActivityExtendedAttributeValue": "userlist2" } }, "formGrid": null, "position": 3 }, { //datachooser "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"DataChooser", "variableId":"dc1", "variableName":"dc1", "className":"com.suncode.cuf.form.datachooser.UserChooser", "criteria":[ "dc1", "tata" ], "mappings":[ { "dcVarId":"userName", "formVarId":"dc1", "name":"Login użytkownika" }, { "dcVarId":"firstName", "formVarId":"", "name":"Imię użytkownika" }, { "dcVarId":"lastName", "formVarId":"", "name":"Nazwisko użytkownika" }, { "dcVarId":"fullName", "formVarId":"", "name":"Imię i nazwisko użytkownika" }, { "dcVarId":"reverseName", "formVarId":"", "name":"Nazwisko i imię użytkownika" }, { "dcVarId":"email", "formVarId":"", "name":"Email" }, { "dcVarId":"orgUnit", "formVarId":"", "name":"Unit" }, { "dcVarId":"superiorsNames", "formVarId":"", "name":"Sups" }, { "dcVarId":"superiors", "formVarId":"", "name":"SupsLogins" } ], "customKeys":{ "rolesVar":"tata", "joinOrgUnits":"true", "type":"combobox", "joinSuperiors":"true" } }, "formGrid":null, "position":4 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":true, "hidden":false, "type":"TextField", "variableId":"dataiczas", "variableName":"dataIczas" }, "formGrid":null, "position":5 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"DataChooser", "variableId":"getusercond", "variableName":"getusercond", "className":"com.plusmpm.CUF.util.DataChoosers.GetUsersWithConditions", "criteria":[ "tata", "calkowita" ], "mappings":[ { "dcVarId":"userId", "formVarId":"getusercond", "name":"Login użytkownika" }, { "dcVarId":"userName", "formVarId":"", "name":"Imię użytkownika" }, { "dcVarId":"userSurname", "formVarId":"", "name":"Nazwisko użytkownika" }, { "dcVarId":"userRealName", "formVarId":"", "name":"Nazwisko i imię użytkownika" }, { "dcVarId":"userEmail", "formVarId":"", "name":"Adres e-mail użytkownika" } ], "customKeys":{ "sortBy":"userRealName", "filterBy":"userRealName", "sortDirection":"asc", "type":"window" } }, "formGrid":null, "position":6 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"DateField", "variableId":"data1", "variableName":"data1", "format":"Y-m-d" }, "formGrid":null, "position":7 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"IntegerField", "variableId":"calkowita", "variableName":"calkowita", "format":null }, "formGrid":null, "position":8 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"DecimalField", "variableId":"float1", "variableName":"float1", "format":null }, "formGrid":null, "position":9 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":true, "hidden":false, "type":"RadioButton", "variableId":"radio", "variableName":"radio", "values":[ "tak", "nie" ] }, "formGrid":null, "position":10 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"CheckBox", "variableId":"check2", "variableName":"check2", "values":[ "1" ] }, "formGrid":null, "position":11 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"CheckBox", "variableId":"check3", "variableName":"check3", "values":[ "domyslny" ] }, "formGrid":null, "position":12 }, { "type":"GRID", "formField":null, "formGrid":{ "title":"tab1", "readOnly":false, "fields":[ { "required":false, "readOnly":false, "hidden":false, "type":"TextField", "variableId":"aaadsd", "variableName":"aaadsd" }, { "required":false, "readOnly":false, "hidden":false, "type":"TextField", "variableId":"pdsasdasd_d_asd", "variableName":"PDASŁ" } ], "gridEvents":[ ], "storeEvents":[ ], "selectionEvents":[ ] }, "position":13 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"TextArea", "variableId":"textarea1", "variableName":"textarea1" }, "formGrid":null, "position":14 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"ListBox", "variableId":"staticlist", "variableName":"staticlist", "values":[ "ABC", "adsa", "asdsaf", "dgdg" ], "editable":false, "filterable":true }, "formGrid":null, "position":15 }, { "type":"FIELD", "formField":{ "required":false, "readOnly":false, "hidden":false, "type":"RoleUsers", "variableId":"rolelist", "variableName":"rolelist", "roleIds":[ "uczestnik_1", "uczestnik_2" ], "ouNames":[ "ou1" ] }, "formGrid":null, "position":16 }, { "type":"FIELD", "formField":{ "required":true, "readOnly":false, "hidden":true, "type":"TextField", "variableId":"hidd", "variableName":"hidd" }, "formGrid":null, "position":17 } ], "buttons":[ //acceptance buttons { "actionName":"zapisz_zestaw", "buttonName":"Zapisz zestaw", "jsAction":"CUF_saveFormTemplateTest" }, { "actionName":"wczytaj_zestaw", "buttonName":"Wczytaj zestaw", "jsAction":"CUF_loadFormTemplateTest" }, { "actionName":"act", "buttonName":"act", "jsAction":null } ] }
AutoUpdate invocation
Path to servlet: api/form/autoupdate
Method: POST
Request Content-Type: application/json
Query Content:
JSON object containing the definition of autoUpdate. The definition should contain the following field:
- autoUpdate - definition of autoUpdate (taken from the form defnition)
- variables - a map of variable values from the dataSource field in the autoUpdate definition. (the key in the map is the id of the variable)
Answer:
- The answer contains a map of processed variable values from the destination parameter of the autoUpdate definition.
DataChooser invocation
Path to servlet: api/form/datachooser
Method: POST
Request Content-Type: application/json
Query Content:
JSON object containing the definition of dataChooser. The definition should contain the following field:
- className - class of datachooser
- start - the beginning of the data
- limit - number of records
- orderProperty - sort field
- order - sorting direction (ASC/DESC)
- criteria - map of variable values
- customKeys - additional keys
- Answer contains the list of data returned by datachooser
Pobranie skryptów formularza
Path to servlet: api/form/scripts
Method: GET
Parameters:
- processId- process Id
- activityId - task Id
- type - type of scripts (case sensitive):
- DESKTOP
- DESKTOP_FORM
- DESKTOP_HISTORY
- MOBILE
- MOBILE_FORM
- MOBILE_HISTORY
[ "scripts/external/desktop/additionalFunction.js", "scripts/external/desktop/cuf/cuf-all.js", "scripts/external/desktop/plusmpmscripts-math.js", "scripts/external/desktop/plusmpmscripts.js" ]