The scripts providing the forms will be dynamically loaded in PWE: Script injection The component would build the form using a function, e.g.: buildForm( form, options ), where the form parameter would be the parameter container, and the options parameter would contain additional information, such as: - destination - available only for the form action, it informs what form component the action is added to, available values are:
- FORM - form
- VARIABLE - variable
- VARIABLESET - dynamic table
- BUTTON - button
- DT_BUTTON - dynamic table button
- acceptButton - takes the value true if the action is added to the accept button
- tableId - identifier of the dynamic table (holds a value when destination takes the value VARIABLESET or DT_BUTTON)
- buttonId - identifier of the button when the action is added to the button (holds a value when destination takes the value BUTTON)
The component depending on the type should be registered using the method: - for form action - PWE.integrationComponent.registerFormAction( id_component, registration )
- for validator - PWE.integrationComponent.registerValidator( id_component, registration )
- for a class that sets variables - PWE.integrationComponent.registerVariablesSetter( id_component, registration )
- for system application - PWE.integrationComponent.registerApplication( id_component, registration )
- for data chooser - PWE.integrationComponent.registerDataChooser( id_component, registration )
Object registration contains following properties: - apiVersion - API version
- labelWidth - parameters form label width, it has to be a number e.g. 150
- buildForm - function that builds parameters form
- validateForm - function that validates parameters form save
You can also register dynamic forms for system functions using the method: PWE.integrationComponent.registerSystemFunction( function_name, function_parameters, registration ) The function parameters are an array of objects with the following properties: - type: type of parameter
- id: identifier of the parameter
- array: information if the parameter is an array (default: false)
It is possible to specify null as the parameter parametry_funkcji which will cause the dynamic form to be registered for all functions with the name specified in the parameter name_function. The registration object has the following properties: - buildForm - a function that builds a form of parameters
- toText - a function that returns a more readable representation, it takes parameters:
- parameterValues - of the Object form (that is, like a map in Java), we can receive individual parameter values by their identifiers, the received parameter value can be a table, or a direct text value, numeric value, etc.
- parameterTypes - of the Object form (that is, like a map in Java), we can receive individual parameter types by their identifiers, each entry in the map is an object that has the following properties:
- type - he name of the parameter type, e.g. string, integer, date, etc.
- array - true or false, indicates whether the parameter is of array type
- apiVersion - the version of the API of the form, the parameter is optional, if it is not specified, the API of the form version V1 is used
Registration of the function can look as follows: Code Block |
---|
| PWE.integrationComponent.registerSystemFunction( 'concat', [ {
type: 'string',
id: 'strings',
array: true
} ], {
apiVersion: 2,
buildForm: function( api, options ) {
api.addField( {
id: 'strings'
} );
},
toText: function( parameters ) {
var strings = parameters['strings'];
return 'konkatenacja( ' + strings.join( ', ' ) + ' )';
}
} ); |
- Ability to deploy parameters in a fairly customized way.
- Ability to plug events into parameter fields:
- change
- blur
- Grouping of parameters (I think only array parameters) - having, for example, 2 array parameters that are related to each other (e.g., setting variables - one parameter with variables and the other with values to be set) there was an option to present them as a pair for which there would be only one button to add another element of the array and this button would simultaneously add fields for all grouped parameters
- Hiding / showing parameters.
The ability to define a selector with values for a parameter with the specification of whether you can enter your own value or select a function or variable. - The ability to filter values, e.g.: for a parameter of type VARIABLE, we could filter what variables would be displayed. E.g., when we would like only variables of type FLOAT.
- Ability to add a simple label, I guess it will be useful for grouping parameters.
- Ability to add a checkbox - would allow to show and hide parameters.
- Ability to define a section that could be collapsed, such a collapsible fieldset.
The form definition might look as follows: Code Block |
---|
buildForm: function( form ) {
//adding a parameter in basic form
form.addField("parameter_id"); //parameter_id is the id of the parameter defined in the component
//adding a parameter with the change event
form.addField({
id: "param_id",
onChange: function(value, options) {
if(value) {
form.showField("hiddenParam");
}
else {
form.hideField("hiddenParam");
}
}
});
//adding a parameter that is hidden during initialization
form.addField({
id: "hiddenParam",
hidden: true //domyślnie false
});
} |
- addField(Object / parameterId) - adds a parameter field at the last position
- insertField(position, Object / parameterId) - adds a parameter field at the specified position (use the getFieldPosition function to determine the position for the field)
- removeField(parameterId) - removes the parameter field
- hideField (parameterId) - hides the parameter field
- showField(parameterId) - shows the parameter
- focusField(parameterId) - sets the cursor in the parameter field
- addLabel("Label text") - adds a label at the last position
- insertLabel(position, "Label text" ) - dodaje etykietę na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition adds a label at the specified position (use the getFieldPosition function to determine the position for a field)
- addCheckbox(Object) - dodaje checkbox na ostatniej pozycji, obiekt definicji zawiera następujące właściwości adds a checkbox at the last position, the definition object contains the following properties:
- name - nazwa polathe name of the field
- description - opis poladescription of the field
- insertCheckbox(position, Object) - adds a label at the specified position (use the getFieldPosition function to determine the position for the field)
- addCombobox(Object) - adds a checkbox at the last position, the definition object contains the following properties:
- id - identifier of a parameter of String type, which will be in the form of a drop-down list, if the id is not given, the parameter does not exist or the variable is of other type than String, an independent drop-down list is added to the parameter form
- text - the label of the field
- value - the initial value
- remote - indicates whether the data of the drop-down list is to be retrieved from the server, or whether it is a static list (default: false), when remote has the value true, the following parameters are passed to the server during data retrieval:
- sort - name of the field by which the data are sorted
- dir - direction of sorting (ASC/DESC)
- query - currently entered value in the drop-down list, used to filter values
- start - offset
- limit - page size
The server must return a json object with fields:
- total - the total number of results
- data - downloaded data including paging
- values - a list of values for the static drop-down list, the property is an array of objects, each of which has the following properties
- id - identifier of the value
- display - name of the value
- description - description of the value
- url - url that returns data from the server for the dynamic dropdown list, it can also be in the form of a function that returns a value of String type, which takes the following parameters:
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of table type, then rowIndex is the position of the current parameter field in the table, the first position has a value of 0
- fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
- name - the name of the field
- type - field type (string, boolean, integer, float, date)
- valueField - the name of the field whose value is to be set as a parameter value
- displayField - the name of the field whose value is displayed in the list
- pageSize - the size of the page (default: 20)
- template - a template describing how to display values in the list, the property is an array of objects, each of which has the following properties:
- label - label for a field
- field - name of the field
- sort - allows you to specify the sorting of data from the server, the property is an object that has the following properties:
- field - the name of the field followed by sorting
- direction - sorting direction (ASC/DESC)
- onChange - a function executed after selecting a value from the list, it takes the following parameters:
- value - the value of the parameter field
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of tabular type, then rowIndex is the position of the current parameter field in the table, the first position is 0
- insertCombobox(position, Object) - add a drop-down list on the specified position (to determine the position for the field, use the getFieldPosition function), the definition object contains the following properties:
- id - identifier of a parameter of String type, which will be in the form of a drop-down list, if the id is not specified, the parameter does not exist or the variable is of other type than String, an independent drop-down list is added to the parameter form
- remote - indicates whether the data of the drop-down list is to be retrieved from the server, whether it is a static list (default: false), when remote has a value of true, then the following parameters are passed to the server during data retrieval:
- sort - the name of the field by which the data is sorted
- dir - sorting direction (ASC/DESC)
- query - currently entered value in drop-down list, used to filter values
- start - offset
- limit - page size
The server must return a json object with fields:
- total - the total number of results
- data - downloaded data including paging
- values - a list of values for the static drop-down list, the property is an array of objects, each of which has the following properties
- id - the identifier of the value
- display - the name of the value
- description - description of the value
- url - url that returns data from the server for the dynamic dropdown list, it can also be in the form of a function that returns a value of String type, which takes the following parameters:
- options - dditional parameters passed to the function
- rowIndex - if the parameter field is of table type, then rowIndex is the position of the current parameter field in the table, the first position has a value of 0
- fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
- name - the name of the field
- type - the type of the field (string, boolean, integer, float, date)
- valueField - the name of the field which value is to be set as a parameter value
- displayField - the name of the field which value is to be displayed in the list
- pageSize - the size of the page (default: 20)
- template - a template describing how the values are displayed in the list, the property is an array of objects, each of which has the following properties:
- label - a label for the field
- field - the name of the field
- sort - allows to specify sorting of data from the server, the property is an object that has the following properties:
- field - name of the field followed by sorting
- direction - sorting direction (ASC/DESC)
- onChange - a function executed after selecting a value from the list, it takes the following parameters:
- value - the value of the parameter field
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of tabular type, then rowIndex is the position of the current parameter field in the table, the first position is 0
- getFieldPosition(parameterId) - returns the position of the parameter field, if the parameter is in a table, the position of the table parameter field is returned
- getFieldValue(parameterId, asString) - returns the value of the parameter field, the value can be returned as a string (asString=true)
- setFieldValue(parameterId, value) - sets the value of the parameter field
- addButton(Object) - adds a button on the last position, the definition object contains the following properties:
- text - the text of the button
- iconCls - system css class for button icon
- tooltip - button tooltip
- handler - function executed after clicking the button
- scope - scope for the function executed after clicking the button, default: window
- insertButton(position, Object) - adds a button at the specified position (use the getFieldPosition function to determine the position for a field), the definition object contains the following properties:
- text - the text of the button
- iconCls - system css class for button icon
- tooltip - button tooltip
- handler - function executed after clicking the button
- scope - scope for the function executed after clicking the button, default: window
- addFieldToArray(parameterId) - adds a new field on the last position in the tabular parameter, the field is not added to the tabular parameter that is in the table
- removeFieldFromArray(parameterId, position) - removes the field at the given position from the tabular parameter, the field is not removed from the tabular parameter, which is in the table
- setFieldValueInArray(parameterId, position, value) - sets the value of the field at the given position in the tabular parameter
- getArraySize(parameterId) - returns the number of fields in the table parameter, or 0 if the field is not a table parameter
- resetArray(parameterId) - removes the row fields (except the first one) from the tabular parameter and clears the value of the first field, the fields are not removed from the tabular parameter, which is in the table
- addTable([ Object / parameterId ], Object) - adds a table (set of tabular fields) on the last position, the table definition object (second parameter) contains the following properties:
- tableId - identifier of the table to hide/show/remove the field
- name - the name of the table
- description - description of the table
- hidden - specifies whether the table is to be hidden
- insertTable(position, [ Object / parameterId ], Object) - adds a table (a collection of table fields) in the specified position (to specify the position for the field, use the getFieldPosition function), the table definition object (the second parameter) contains the following properties:
- tableId - identifier of the table, which allows you to hide/show/remove the field
- name - the name of the table
- description - description of the table
- hidden - specifies whether the table is to be hidden
- addDataChooserMapping(Object) - adds data chooser mapping, is relevant only for the data chooser component, the mapping object contains the following properties:
- id - mapping id
- description - mapping description
- variableId - id of the process variable to which the selected value in the data chooser is mapped
- name - text displayed for mapping during the presentation of data chooser results on the task form
- hidden - informs whether the mapping is to be hidden on the task form
- verify - informs whether the mapping is to be validated on the task form
- readOnly - informs which values cannot be edited in a given mapping, accepted values are:
- true/false - boolean variable, informs that none of the mapping values can be edited
- string - a variable of the string type, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
- array - tabular variable, informs which mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
- resetDataChooserMappings() - removes all data choose mappings, only relevant for the data chooser component
- id,
- onChange,
- onBlur,
- hidden,
- optional,
- notEmpty,
- value,
- readOnly
- hideLabel
- values - list of drop-down list value objects, each object contains properties id (value identifier), display (value displayed on the list), description (value description on the list)
- url - url returning data from the server for a dynamic dropdown list, can also be in the form of a function
- addField(Object / parameterId, position) - adds the parameter field at the specified position (use the getFieldPosition function to determine the position for the field), the position parameter is optional, if not specified, the object is added at the last position
- removeField(parameterId) - removes the parameter field
- hide (parameterId) - hides the parameter
- show(parameterId) - shows the parameter
- focusField(parameterId) - places the cursor in the parameter field
- addLabel("Label text", position) - adds the label at the specified position (to determine the position for the field, use the getFieldPosition function), the position parameter is optional, if not specified, the object is added at the last position
- addCheckbox(Object, position) - adds a checkbox at the specified position (in order to determine the position for the field you should use the getFieldPosition function), the position parameter is optional, if not specified, the object is added at the last position, the definition object contains the following properties:
- id - checkbox identifier of String type, it is possible to set checkbox value with identifier
- name - name of the field
- description - description of the field
- bindedFieldId - identifier of a parameter of logical type, its value reflects whether the checkbox is selected, changing the checkbox selection affects the value of the associated field
- addCombobox(Object, position) - adds a drop-down list at the specified position (to determine the position for the field, use the getFieldPosition function), the position parameter is optional, if not specified, the object is added at the last position, the definition object contains the following properties:
- id - the identifier of the parameter of type String, which will be in the form of a drop-down list, if the id is not given, the parameter does not exist or the variable is of type other than String, then an independent drop-down list is added to the parameter form
- name - the label of the field
- description - the description of the field
- value - initial value
- optional - indicates whether the value is required (default: false)
- forceSelection - informs that the parameter can only accept values in the list (default: true)
- remote - configuration for downloading data from the server, its absence informs that the list is a static list (default: null), contains such properties as:
- url - url that returns data from the server for the dynamic dropdown list, it can also be in the form of a function that takes the following parameters:
- options - additional parameters transferred to the function
- rowIndex - if the parameter field is of tabular type, then rowIndex is the position of the current parameter field in the array, the first position has a value of 0
- fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
- name - the name of the field
- type - the type of the field (string, boolean, integer, float, date)
- remoteSort - indicates whether the sorting is to be done on the server side or on the browser side (default: false - on the browser side)
- pageSize - the size of the page (default: 25)
The server must return a json object with fields:
- total - the total number of results
- data - downloaded data including paging
- values - a list of values for the static drop-down list, the property is an array of objects, each of which has the following properties
- id - the identifier of the value
- display - the name of the value
- description - description of the value
- valueField - the name of the field whose value is to be set as a parameter value
- displayField - the name of the field whose value is displayed in the list
- template - a template describing how the value is displayed in the list, the property is an array of objects, each of which has the following properties:
- label - a label for the field
- field - the name of the field
- sort - allows to define the sorting of data from the server, the property is an array of objects, each having the following properties:
- property - the name of the field followed by sorting
- direction - sorting direction (ASC/DESC)
- listeners - obiekt zawierający zdarzenia, obsługowane są następujące zdarzenia
- change - funkcja wykonywana po wybraniu wartości z listy, przyjmuje następujące parametry:
- value - wartość pola parametru
- options - dodatkowe parametry przekazywane do funkcji
- rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
blur - funkcja wywoływana po wyjściu z pola, przyjmuje następujące parametry:- value - wartość pola parametru
options - dodatkowe parametry przekazywane do funkcjirowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość object containing events, the following events are supported
- change - function executed after selecting a value from the list, accepts the following parameters:
- value - the value of the parameter field
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of table type, rowIndex is the position of the current parameter field in the table, the first position has a value of 0
- blur - the function called when the field is exited, it accepts the following parameters:
- value - the value of the parameter field
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of table type, rowIndex is the position of the current parameter field in the table, the first position has a value of 0
getFieldPosition(parameterId) - zwraca pozycję pola parametru, jeżeli parametr znajduje się w tabeli, to zwracana jest pozycja pola parametru tabeli returns the position of the parameter field, if the parameter is in a table, the position of the table parameter field is returnedgetValue(parameterId, asString) - zwraca wartość pola parametru, wartość może być zwrócona w postaci returns the value of the parameter field, the value can be returned as a string (asString=true)setValue(parameterId, value) - ustawia wartość pola parametrusets the value of the parameter fieldaddButton(Object, position) - dodaje przycisk na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, obiekt definicji zawiera następujące właściwości:
- text - teskt przycisku
- iconCls - systemowa klasa css dla ikony przycisku
- tooltip - tooltip przycisku
- handler - funkcja wykonywana po kliknięciu w przycisk
- scope - scope dla funkcji wykonywanej po kliknięciu w przycisk, domyślnie: window
addFieldToArray(parameterId) - dodaje nowe pole na ostatniej pozycji w parametrze tabelarycznym, pole nie jest dodawane do parametru tabelarycznego, który znajduje się w tabeliadds the button at the specified position (to determine the position for the field, use the getFieldPosition function), the position parameter is optional, if not specified, the object is added at the last position, the definition object contains the following properties:
- id - button id
- text - the text of the button
- iconCls - system css class for button icon
- tooltip - buttontooltip
- handler - function executed after clicking the button
- scope - scope for the function executed after clicking the button, default: window
hideButton(buttonId) - hides buttonshowButton(buttonId) - shows buttonaddFieldToArray(parameterId) - adds a new field on the last position in the table parameter, the field is not added to the table parameter that is in the tableremoveFieldFromArray(parameterId, position) - usuwa pole z danej pozycji z parametru tabelarycznego, pole nie jest usuwane z parametru tabelarycznego, który znajduje się w tabeliremoves the field at the given position from the tabular parameter, the field is not removed from the tabular parameter that is in the tablesetFieldValueInArray(parameterId, position, value) - ustawia wartość pola na danej pozycji w parametrze tabelarycznymsets the value of the field at the given position in the tabular parametergetArraySize(parameterId) - zwraca ilość pól w parametrze tabelarycznym lub 0, jeśli pole nie jest parametrem tabelarycznym returns the number of fields in the table parameter or 0 if the field is not a table parameterresetArray(parameterId) - usuwa pola wiersze (poza pierwszym) z parametru tabelarycznego i czyści wartość pierwszego pola, pola nie są usuwane z parametru tabelarycznego, który znajduje się w tabeliremoves the row fields (except the first one) from the tabular parameter and clears the value of the first field, the fields are not removed from the tabular parameter, which is in the tableremoveLastArrayFields(parameterId, amount) - usuwa określoną ilość pól wierszy z parametru tabelarycznego i czyści wartość pierwszego pola, pola nie są usuwane z parametru tabelarycznego, który znajduje się w tabeliremoves the specified number of row fields from the tabular parameter and clears the value of the first field, the fields are not removed from the tabular parameter, which is in the tableaddDataChooserMapping(Object) - dodaje mapping data choose'a, ma znaczenie tylko dla komponentu data chooser'a, obiektmappingu zawiera następujące właściwościadds data chooser mapping, it is relevant only for data chooser component, mapping object contains the following properties:
- id - mapping id mappingu
- description - opis mappingumapping description
- variableId - id zmiennej procesu, na którą jest mapowana wybrana wartość w data chooser
- name - tekst wyświetlany dla mappingu podczas prezentacji rezultatów data chooser'a na formularzu zadania
- hidden - informuje, czy mapping ma być ukryty na formularzu zadania
- verify - informuje, czy mapping ma być walidowany na formularzu zadania
- readOnly - informuje, które wartości nie mogą być edytowane w danym mappingu, akceptowane wartości to:
- true/false - zmienna typu boolean, informuje, że żadna z wartości mappingu nie może być edytowana
string - zmienna typu string, informuje, która z wartości mappingu nie może być edytowana (akceptowane wartości toof the process variable, to which the selected value in data chooser is mapped name - the text displayed for the mapping when presenting the data chooser results on the task formhidden - indicates whether the mapping is to be hidden on the task formverify - indicates whether the mapping is to be validated on the task formreadOnly - informs which values cannot be edited in a given mapping, accepted values are:
- true/false - variable of boolean type, indicates that none of the mapping values can be edited
- string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
- array - a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
updateDataChooserMapping(id, Object) - updates data chooser mapping by id, it is relevant only for data chooser component, mapping object can contain the following properties:
- description - mapping description
- variableId - id of the process variable, to which the selected value in data chooser is mapped
- name - the text displayed for the mapping when presenting the data chooser results on the task form
- hidden - indicates whether the mapping is to be hidden on the task form
- verify - indicates whether the mapping is to be validated on the task form
- readOnly - informs which values cannot be edited in a given mapping, accepted values are:
- true/false - variable of boolean type, indicates that none of the mapping values can be edited
- string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
- array - zmienna tabelaryczna, informuje, które z wartości mappingu nie mogą być edytowane (akceptowane wartości to: a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
removeDataChooserMapping(id) - removes data chooser mapping by id, it is relevant only for data chooser componentchangeDataChooserMappingPosition(id, position) - moves data chooser mapping by id, position starts from 0 and cannot be greater that mapping count -1, it is relevant only for data chooser componentgetAllDataChooserMappings() - returns list of all data chooser mappings, it is relevant only for data chooser component, each mapping object contains the following properties:
- id - mapping id
- description - mapping description
- variableId - id of the process variable, to which the selected value in data chooser is mapped
- name - the text displayed for the mapping when presenting the data chooser results on the task form
- hidden - indicates whether the mapping is to be hidden on the task form
- verify - indicates whether the mapping is to be validated on the task form
- readOnly - informs which values cannot be edited in a given mapping, accepted values are:
- true/false - variable of boolean type, indicates that none of the mapping values can be edited
- string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
- array - a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
resetDataChooserMappings() - usuwa wszystkie mappingi data choose'a, ma znaczenie tylko dla komponentu data chooser'aremoves all data chooser mappings, only relevant for data chooser componentaddTable(Object, position) - dodaje tabelę na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, obiekt definicji tabeli zawiera następujące właściwości: id - identyfikator tabeli, który pozwala ukrywać/pokazywać/usuwać polename - nazwa tabelidescription - opis tabelihidden - określa, czy tabela ma zostać ukrytablocked - określa, czy pojawią się przyciski dodawania/usuwania wierszy w utworzonej tabeli, domyślnie: falsenotEmpty - określa, czy wszystkie pola w tabeli muszą mieć dodany przynajmniej jeden wiersz Metoda zwraca API tabeli, które posiada następujące operacje:adds the table at the specified position (use getFieldPosition function to determine the position for a field), the position parameter is optional, if not specified, the object is added at the last position, the table definition object contains the following properties: enable(parameterId) - odblokowuje pole parametru- id - identifier of the table to hide/show/remove the field
- name - the name of the table
- description - description of the table
- hidden - determines whether the table is to be hidden
- blocked - determines whether buttons for adding/removing rows in the created table will appear, default: false
- notEmpty - determines whether all fields in the table must have at least one row added
- addField(Object / parameterId, position) - dodaje pole parametru tabelarycznego na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycjiadds a table parameter field at the specified position, the position parameter is optional, if not specified, the object is added at the last position
- addCombobox(Object, position) - dodale listę rozwijaną w formie tabeli na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, definicja listy rozwijanej - patrz punkt adds a drop-down list in the form of a table at the specified position, the position parameter is optional, if not specified, the object is added at the last position, for the definition of the drop-down list - see section 8.
- addRow([ Object ], position) - dodaje nowy wiersz do tabeli na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, pierwszy parametr jest opcjonalny i zawiera wartości poszczególnych pól w tabeli, definicja obiektu jednej wartości jest następująca:
- id - identyfikator pola tablicowego
- value - wartość pola
- removeRow(position) - usuwa wiersz tabeli na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest usuwany z ostatniej
- clear - czyści zawartość tabeli
addRow(position) - dodaje pusty wiersz na pola parametrów ułożone horyzontalnie na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, metoda zwraca API dla wiersza, które jest tożsame z API V2 (dodawanie kolejnych pól realizujemy więc metodą addField z pozycji 1.)disable(parameterId) - blokuje pole parametru- adds a new row to the table at the specified position, the position parameter is optional, if not specified, the object is added at the last position, the first parameter is optional and contains the values of each field in the table, the definition of the single value object is as follows:
- id - table field identifier
- value - the value of the field
- removeRow(position) - removes the table row at the specified position, the position parameter is optional, if not specified, the object is removed from the last one
- clear - clears the contents of the table
addRow(position) - adds an empty row to the parameter fields arranged horizontally at the specified position, the position parameter is optional, if not specified, the object is added at the last position, the method returns the API for the row, which is the same as the V2 API (so adding more fields is implemented by the addField method from position 1.).disable(parameterId) - blocks the parameter fieldenable(parameterId) - unlocks the parameter fieldresetValue(parameterId, silent) - usuwa wartość pola parametru, jeżeli silent ma wartość true, to po zmianie wartości nie jest wykonywana funkcja onChangedeletes the value of the parameter field, if silent is true, the onChange function is not executed after changing the valuehasVariableValue(parameterId, position) - informuje, czy pole parametru posiada zmienną jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane pola indicates whether the parameter field has a variable as a value, the position parameter is taken into account for table and array fields, if it is given, it checks the value of only the field at a specific position, otherwise all currently added fields are checkedhasVariableArrayValue(parameterId, position) - informuje, czy pole parametru posiada zmienną tabelaryczną jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane polaindicates whether the parameter field has a table variable as a value, the position parameter is taken into account for table and array fields, if it is given, it checks the value of only the field at a specific position, otherwise all currently added fields are checkedhasFunctionValue(parameterId, position) - informuje, czy pole parametru posiada funkcję jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane polaindicates whether the parameter field has a function as a value, the position parameter is taken into account for table and array fields, if it is given, it checks the value of only the field on a specific position, otherwise all currently added fields are checkedsetNotEmpty(parameterId, notEmpty) - pozwala ustawić wartość właściwości notEmptyallows you to set the value of the notEmpty propertysetErrorHandling(Object) - pozwala ustawić obsługę błędów aplikacji systemowej, funkcja dostępna tylko dla komponentów aplikacji, obiekt obsługi błedu przyjmuje następujące właściwościallows you to set the error handling of the system application, the function is available only for application components, the error handling object takes the following properties:
- type - typu string , doopuszczalne wartości to STOP i type, acceptable values are STOP and CONTINUE
- comment - typu string lub obiekt pobrany bezpośrednio jako wartość innego parametrustring type or an object taken directly as a value of another parameter
- userMessage - typu string lub obiekt pobrany bezpośrednio jako wartość innego parametrustring type or an object taken directly as the value of another parameter
- addErrorToComment - typu boolean lub obiekt pobrany bezpośrednio jako wartość innego parametrusetters - obiekt zawierający następujące właściwościboolean type or an object taken directly as a value of another parameter
- setters - object containing the following properties:
- variables - tablica identyfikatorów zmiennych, wartości typu string lub obiekt pobrany bezpośrednio jako wartość innego parametruvalues - tablica wartości zmiennych, wartości typu string lub obiekt pobrany bezpośrednio jako wartość innego parametruan array of variable identifiers, string-type values or an object taken directly as the value of another parameter
- values - an array of variable values, string type values or an object taken directly as the value of another parameter
block(parameterId) - blokuje możliwość zmiany rozmiaru pola tablicowego i tabelatycznego (ukrywa przyciski dodawania/usuwania pólblocks the ability to resize table and table fields (hides the add/remove field buttons)unblock(parameterId) - odblokowuje możliwość zmiany rozmiaru pola tablicowego i tabelatycznego (pokazuje przyciski dodawania/usuwania pólunblocks the ability to resize table and tabular fields (shows the add/remove field buttons)addEmptyLine(position) - dodaje pustą linię na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycjiadds an empty line at the specified position (use the getFieldPosition function to determine the position for the field), the position parameter is optional, if not specified, the object is added at the last positionaddFieldSet(Object, position) - dodaje zgrupowany zestaw pól na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, obiekt definicji zgrupowanego zestawu pól zawiera następujące właściwości:id - identyfikator zgrupowanego zestawu póltitle - tytuł zgrupowanego zestawu pólcollapsible - określa, czy zgrupowany zestaw pól może być zwijany i rozwijany, domyślnie: falsecollapsed - określa, czy zgrupowany zestaw pól jest początkowo zwinięty, domyślnieadds a grouped set of fields at the specified position (in order to determine the position for the field, use the getFieldPosition function), the position parameter is optional, if not specified, the object is added at the last position, the definition object of the grouped set of fields:
- id - identifier of the grouped set of fields
- title - the title of the grouped set of fields
- collapsible - specifies whether the grouped set of fields can be collapsed and expanded, default: false
- collapsed - specifies whether the grouped set of fields is initially collapsed, default: false
collapseFieldSet(id) - zwija zgrupowany zestaw pólcollapses the grouped set of fieldsexpandFieldSet(id) - rozwija zgrupowany zestaw pólexpands the grouped set of fieldstoggleFieldSet(id) - zmienia stan zgrupowanego zestawu pól w zależności od tego, czy jest on zwinięty/rozwiniętyspecifies whether the grouped set of fields can be collapsed and expanded, default: falseaddColorPicker(Object / parameterId, position) - dodaje paletę kolorów na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest dodawany na ostatniej pozycji, paleta kolorów może zostać jedynie dodana do parametrów typu adds a color palette at the specified position (use the getFieldPosition function to determine the position for the field), the position parameter is optional, if not specified, the object is added at the last position, the color palette can only be added to parameters of type STRINGisDataChooserInTable(id) - zwraca true, jeśli zmienna o podanym identyfikatorze jest dynamiczną listą i jest umiejscowiona w tabeli, w przeciwnym razie zwraca false, możliwe jest pominięcie id, jeżeli jesteśmy aktualnie w edycji zmiennej procesu typu dynamiczna listaactivateRebuildParameters() - aktywuje przebudowanie dynamicznego formularza parametrów po wystąpieniu następujących zdarzeń- zmiana położenia zmiennej procesu typu dynamiczna lista
deactivateRebuildParameters() - dezaktywuje przebudowanie dynamicznego formularza parametrów po wystąpieniu następujących zdarzeń- zmiana położenia zmiennej procesu typu dynamiczna lista
showMessage(Object) - wyświetla wiadomość w pop-up'ie z przyciskiem OK, obiekt konfiguracji zawiera następujące właściwości:- message - treść wiadomości
- title - tytuł okna
getAllTasks - zwraca listę wszystkich zadań, które aktualnie występują w procesie. Obiekt każdego zadania na liście posiada następujące właściwości:- id - identyfikator definicji zadania
- name - nazwa zadania
getAllRoles - zwraca listę wszystkich ról, które aktualnie występują w procesie. Obiekt każdej roli na liście posiada następujące właściwości:- id - identyfikator roli
- name - nazwa roli
getAllGlobalTables - zwraca listę wszystkich globalnych tabel dynamicznych, które aktualnie występują w procesie. Obiekt każdej tabeli na liście posiada następujące właściwości:- id - identyfikator tabeli
- name - nazwa (tytuł) tabeli
- columns - lista identyfikatorów zmiennych procesu, które zostały użyte jako kolumny tabeli
getGlobalTable(tableId) - zwraca definicję globalnej tabeli dynamicznej lub null, jeśli nie istnieje tabela o podanym identyfikatorze. Obiekt tabeli posiada następujące właściwości:id - identyfikator tabeliname - nazwa (tytuł) tabelicolumns - lista identyfikatorów zmiennych procesu, które zostały użyte jako kolumny tabelireturns true if the variable with the specified id is a dynamic list and is located in a table, otherwise returns false, it is possible to omit the id if we are currently in the edit process variable of the dynamic list typeactivateRebuildParameters() - activates the rebuilding of the dynamic parameter form after the occurrence of the following events
- change of position of the process variable of the dynamic list type
deactivateRebuildParameters() - deactivates the rebuilding of the dynamic parameter form after the occurrence of the following events
- change of position of a process variable of the dynamic list type
showMessage(Object) - displays a message in a pop-up with an OK button, the configuration object contains the following properties:
- message - message content
- title - the title of the window
getAllTasks -returns a list of all tasks that currently exist in the process. The object of each task in the list has the following properties:- id - task definition identifier
- name - name of the task
getAllRoles - returns a list of all roles that currently exist in the process. The object of each role in the list has the following properties:- id - role identifier
- name - the name of the role
getAllVariables - returns a list of all variables that currently exist in the process. The object of each table in the list has the following properties:
- id - variable identifier
- name - variable name
type - variable type Variable type | Value passed |
---|
String | STRING | Text area | TEXTAREA | Date and time | DATETIME | Date | DATE | Integer | INTEGER | Float | FLOAT | Boolean | BOOLEAN | Amount | AMOUNT | Radiobutton | RADIOBUTTON | Checkbox | CHECKBOX | Listbox | LISTBOX | System users table | USERLIST | System users list | USERLISTLISTBOX | Filtered users list with role | ROLEUSERS | Filtered users list with role | ROLEUSERS_NO_FILTER | Data chooser | DATA_CHOOSER |
destination - variable placement Variable placement | Value passed |
---|
Form | form | Table | table |
getAllGlobalTables - returns a list of all global dynamic tables that currently exist in the process. The object of each table in the list has the following properties:
- id - table identifier
- name - name (title) of the table
- columns - a list of identifiers of process variables, which were used as table columns
getGlobalTable(tableId) - returns the definition of the global dynamic table, or null if there is no table with the specified identifier. The table object has the following properties:
- id - table identifier
- name - name (title) of the table
- columns - a list of identifiers of process variables, which were used as table columns
showHint(parameterId, hint, type) - wyświetla podpowiedź pod danym parametrem/tabelą. Funkcja przyjmuje następujące parametrydisplays a hint under the given parameter/table. The function takes the following parameters:
- parameterId - identyfikator parametru, może być też identyfikatorem tabeliparameter identifier, it can also be a table identifier
- hint - treść podpowiedzithe content of the hint
- type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości totype of hint (responsible for the color of the text), available values are:
- INFO - czarnyblack
- SUCCESS - zielonygreen
- ERROR - czerwonyred
showHintInArray(parameterId, position, hint, type) - wyświetla podpowiedź pod danym polem w parametrze tabelarycznym. Funkcja przyjmuje następujące parametrydisplays a hint under the given field in the table parameter. The function takes the following parameters:
- parameterId - identyfikator parametru, może być też identyfikatorem tabeli
- position - indeks parametru w tabeli
- hint - treść podpowiedzi
- type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
- INFO - czarny
- SUCCESS - zielony
ERROR - czerwonyparameter identifier, it can also be a table identifier position - index of the parameter in the tablehint - the content of the hinttype - type of hint (responsible for the color of the text), available values are:
- INFO - black
- SUCCESS - green
- ERROR - red
hideHint(parameterId) - ukrywa podpowiedź pod danym parametrem/tabeląhides the hint under the given parameter/tablehideHintInArray(parameterId, position) - ukrywa podpowiedź pod danym polem w parametrze tabelarycznymhides the hint under the given field in the table parameter
Combobox API: - addValues(Object/Array) - dodaje do listy rozwijanej kolejne pozycje (patrz values w metodzie addCombobox), dotyczy tylko tych list rozwijanych, które działają lokalnieadds more positions to the drop-down list (see values in the addCombobox method), applies only to those drop-down lists that work locally
- setValues(Object/Array) - zmienia pozycje na liście rozwijanej (patrz values w metodzie addCombobox), dotyczy tylko tych list rozwijanych, które działają lokalniechanges positions in the drop-down list (see values in the addCombobox method), applies only to those drop-down lists that work locally
- setUrl(url) - ustawia url zwracający dane z serwera, dotyczy tylko tych list rozwijanych, które pobierają dane z serwera, wartość parametru url musi być typu sets the url that returns data from the server, applies only to those dropdown lists that retrieve data from the server, the value of the url parameter must be of type String
- setForceSelection(forceSelection) - ustawia wartość pola forceSelectionsets the value of the forceSelection field
- id
- name
- description
- type
- listeners
- afterrender - funkcja wykonywana po wyrenderowaniu pola (dostępna jest już jego wartość), przyjmuje następujące parametry:options - dodatkowe parametry przekazywane do funkcji
rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość function executed after the field is rendered (its value is already available), it takes the following parameters:
- options - additional parameters passed to the function
- rowIndex - if the parameter field is of table type, then rowIndex is the position of the current parameter field in the table, the first position has a value of 0
- change
- blur
- select (dla listy rozwijanejfor a drop-down list)
- addfield (dla pola typu tablicowego, parametrem jest pozycja polafor an table-type field, the parameter is the position of the field)
- hidden
- disabled
- optional
- notEmpty
- value
- readOnly
- hideLabel
- disableVariableDuplication - dla pola typu tablicowego, informuje, czy zablokować możliwość wyboru tej samej zmiennej w różnych polach parametru tablicowego
- values - lista obiektów wartości listy rozwijanej, każdy obiekt zawiera właściwości id (identyfikator wartości), display (wartość wyświetlana na liście), description (opis wartości na liście)
- arrayMinLength - dotyczy parametrów tablicowych, minimalna ilość pól, jakie muszą zostać dodane w celu pozytywnej walidacji pola, wartość domyślna: 0 (pole jest zawsze walidowane pozytywnie)
Możliwe jest przeprowadzenie własnej walidacji formularza. Jeżeli dla danego komponentu zostanie zarejestrowana metoda validateForm( api ), to oprócz standardowej walidacji wymagalności pól, będzie można sprawdzić inne warunki we własnym zakresie. Metoda powinna zwrócić false, jeśli proces zapisu formularza ma zostać przerwany. Dodatkowo można zwrócić obiekt, który w zależności od ustawionej właściwości będzie definiował inne zachowania: confirm: true - wyświetla okno wymagające potwierdzenia kontynuwacji zapisu, dodatkowe właściwości obiektu to:title - tytuł okna potwierdzenia (domyślnie: Uwaga)message - wiadomość wyświetlona w oknie potwierdzenia- for a field of table type, indicates whether to block the possibility of selecting the same variable in different fields of the table parameter
- values - list of drop-down list value objects, each object contains properties id (value identifier), display (value displayed in the list), description (description of the value in the list)
- arrayMinLength - applies to table parameters, the minimum number of fields that must be added to positively validate the field, default value: 0 (the field is always positively validated)
It is possible to perform your own form validation. If the validateForm( api ) method is registered for the component, you will be able to check other conditions on your own, in addition to the standard validation of field requirements. The method should return false if the form saving process is to be aborted. In addition, you can return an object that, depending on the property set, will define other behavior: - confirm: true - displays a window requiring confirmation to continue saving, additional properties of the object are:
- title - title of the confirmation window (default: Attention)
- message - the message displayed in the confirmation window
Code Block |
---|
{
confirm: true,
title: 'PotwierdźConfirm zapissaving',
message: 'CzyDo chceszyou kontynuować zapiswant to continue saving?'
} |
API dostarczone jako parametr metody umożliwia korzystanie z następujących funkcjiThe API provided as a method parameter allows you to use the following functions: - getFieldPosition(parameterId) - zwraca pozycję pola parametru, jeżeli parametr znajduje się w tabeli, to zwracana jest pozycja pola parametru tabelireturns the position of the parameter field, if the parameter is in a table, the position of the table parameter field is returned
- getValue(parameterId, asString) - zwraca wartość pola parametru, wartość może być zwrócona w postaci returns the value of the parameter field, the value can be returned as a string (asString=true)
- getArraySize(parameterId) - zwraca ilość pól w parametrze tabelarycznym lub 0, jeśli pole nie jest parametrem tabelarycznymreturns the number of fields in the table parameter or 0 if the field is not a table parameter
- hasVariableValue(parameterId, position) - informuje, czy pole parametru posiada zmienną jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane polaindicates whether the parameter field has a variable as a value, the position parameter is taken into account for table and table fields, if it is given, it checks the value of only the field at a specific position, otherwise all currently added fields are checked
- hasVariableArrayValue(parameterId, position) - informuje, czy pole parametru posiada zmienną tabalaryczną jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane polaindicates whether the parameter field has a table variable as a value, the position parameter is taken into account for table and table fields, if it is specified, it checks the value of only the field at a specific position, otherwise all currently added fields are checked
- hasFunctionValue(parameterId, position) - informuje, czy pole parametru posiada funkcję jako wartość, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to sprawdza wartość tylko polu na konkretnej pozycji, w przeciwnym przypadku sprawdzane są wszystkie aktualnie dodane polaindicates whether the parameter field has the function as a value, the position parameter is taken into account for table and table fields, if given, it checks the value of only the field at a specific position, otherwise all currently added fields are checked
- getFunctionReturnType(parameterId, position) - zwraca typ wartości zwracanej przez funkcję podanej jako wartość danego parametru, parametr position jest uwzględniany dla pól tablicowych, jeżeli jest podany, to zwraca typ tylko dla pola na konkretnej pozycji, w przeciwnym przypadku zwracana jest tablica typówreturns the type of the value returned by the function given as the value of the given parameter, the position parameter is taken into account for table fields, if given, it returns the type only for the field on a specific position, otherwise an array of types is returned
- getVariableType(parameterId, position) - zwraca typ zmiennej podanej jako wartość danego parametru, parametr position jest uwzględniany dla pól tablicowych, jeżeli jest podany, to zwraca typ tylko dla pola na konkretnej pozycji, w przeciwnym przypadku zwracana jest tablica typówreturns the type of the variable given as the value of the given parameter, the position parameter is taken into account for table fields, if given, it returns the type only for the field on a specific position, otherwise an array of types is returned
- markError(parameterId, position) - zaznacza pole jako błędne, parametr position jest uwzględniany dla tabeli i pól tablicowych, jeżeli jest podany, to zaznacza pola na konkretnej pozycji, w przeciwnym przypadku zaznaczane są wszystkie aktualnie dodane polamarks the field as incorrect, the position parameter is taken into account for table and table fields, if given, it marks fields on a specific position, otherwise all currently added fields are marked
- showErrorMessage(errorMessage) - wyświetla komunikat błędudisplays an error message
- showHint(parameterId, hint, type) - wyświetla podpowiedź pod danym parametrem/tabelą. Funkcja przyjmuje następujące parametrydisplays a hint under the given parameter/table. The function accepts the following parameters:
- parameterId - identyfikator parametru, może być też identyfikatorem tabeliparameter identifier, it can also be a table identifier
- hint - treść podpowiedzithe content of the hint
- type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości totype of hint (responsible for the color of the text), available values are:
- INFO - czarnyblak
- SUCCESS - zielonygreen
- ERROR - czerwonyred
- showHintInArray(parameterId, position, hint, type) - wyświetla podpowiedź pod danym polem w parametrze tabelarycznym. Funkcja przyjmuje następujące parametrydisplays a hint under the given field in the table parameter. The function takes the following parameters:
- parameterId - identyfikator parametru, może być też identyfikatorem tabeli
- position - indeks parametru w tabeli
- hint - treść podpowiedzi
- type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
- INFO - czarny
- SUCCESS - zielony
ERROR - czerwonyidentifier of the parameter, it can also be an identifier of the table
- position - index of the parameter in the table
- hint - the content of the hint
- type - type of hint (responsible for the color of the text), available values are:
- INFO - black
- SUCCESS - green
- ERROR - red
hideHint(parameterId) - ukrywa podpowiedź pod danym parametrem/tabeląhides the hint under the given parameter/tablehideHintInArray(parameterId, position) - ukrywa podpowiedź pod danym polem w parametrze tabelarycznymhides the hint under the given field in the table parameter |