Skrypty dostarczające formularze będą dynamicznie ładowane w PWE: Wstrzykiwanie skryptów

Komponent budowałby formularz za pomocą funkcji np.: buildForm( form, options ), gdzie parametr form byłby kontenerem parametrów, a parametr options zawierał dodatkowe informacje, takie jak:

  1. destination - dostępny tylko dla akcji formularza, informuje o tym, do jakiego komponentu formularza akcja jest dodawana, dostępne wartości, to:
    1. FORM - formularz
    2. VARIABLE - zmienna
    3. VARIABLESET - tabela dynamiczna
    4. BUTTON - przycisk
    5. DT_BUTTON - przycisk tabeli dynamicznej
  2. acceptButton - przyjmuje wartość true, jeśli akcja jest dodawana do przycisku akceptacji 
  3. tableId - identyfikator tabeli dynamicznej (posiada wartość, gdy destination przyjmuje wartość VARIABLESET lub DT_BUTTON)
  4. buttonId - identyfikator przycisku, gdy akcja jest dodawana do przycisk (posiada wartość, gdy destination przyjmuje wartość BUTTON)

 

Komponent w zależności od typu należy zarejestrować za pomocą metody:

  • dla akcji formularza - PWE.integrationComponent.registerFormAction( id_komponentu, rejestracja )
  • dla walidatora - PWE.integrationComponent.registerValidator( id_komponentu, rejestracja )
  • dla klasy ustawiającej zmienne - PWE.integrationComponent.registerVariablesSetter( id_komponentu, rejestracja )
  • dla aplikacji systemowej - PWE.integrationComponent.registerApplication( id_komponentu, rejestracja )
  • dla data chooser'a - PWE.integrationComponent.registerDataChooser( id_komponentu, rejestracja )

 

Obiekt rejestracja posiada następujące właściwości:

  • apiVersion - wersja API
  • labelWidth - szerokość etykiety parametrów formularza, przyjmuje wartość liczbową np. 150
  • buildForm - funkcja budująca formularz parametrów
  • validateForm - funkcja walidująca zapis formularza parametrów
 

 

Można rejestrować także dynamiczne formularze dla funkcji systemowych za pomocą metody:

PWE.integrationComponent.registerSystemFunction( nazwa_funkcji, parametry_funkcji, rejestracja )

Parametry funkcji są tablicą obiektów o następujących właściwościach:

  • type: typ parametru
  • id: identyfikator parametru
  • array: informacja, czy parametr jest tablicowy (domyślnie: false)

Jako parametr parametry_funkcji możliwe jest podanie null, co spowoduje, że dynamiczny formularz zostanie zarejestrowany dla wszystkich funkcji o nazwie podanej w parametrze nazwa_funkcji.

Obiekt rejestracja posiada następujące właściwości:

  1. buildForm - funkcja budująca formularz parametrów
  2. toText - funkcja zwracająca bardziej czytelną reprezentację, przyjmuje ona parametry:
    1. parameterValues - postaci Object (czyli jak mapa w Java), możemy otrzymywać poszczególne wartości parametrów po ich identyfikatorach, otrzymana wartość parametru może być tabelą, albo bezpośrednią wartością tekstową, liczbową itd.
    2. parameterTypes - postaci Object (czyli jak mapa w Java), możemy otrzymywać poszczególne typy parametrów po ich identyfikatorach, każdy wpis w mapie jest obiektem, który posiada następujące właściwości:
      1. type - nazwa typu parametru np. string, integer, date itd.
      2. array - true lub false, informuje, czy parametr jest typu tablicowego
  3. apiVersion - wersja API formularza, parametr jest opcjonalny, jeśli nie jest podany, to jest wykorzystywane API formularza w wersji V1

 

Rejestracja funkcji może wyglądać następująco:

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( ', ' ) + ' )';
						}
					} );

 

Założenia

  1. Możliwość rozmieszczania parametrów w miarę dowolny sposób.
  2. Możliwość podpinania zdarzeń pod pola parametrów:
    1. change
    2. blur
  3. Grupowanie parametrów (chyba tylko tablicowych) - chodzi o to, żeby mając np 2 parametry tablicowe, które są ze sobą powiązane (np ustawianie zmiennych - jeden parametr ze zmiennymi, a drugi z wartościami do ustawienia) była możliwość przedstawienia ich jako pary dla której byłby tylko jeden przycisk dodawania kolejnego elementu tablicy i ten przycisk jednocześnie dodawałby pola dla wszystkich zgrupowanych parametrów (wink)
  4. Ukrywanie / pokazywanie parametrów.
  5. Możliwość zdefiniowania wybieracza z wartościami dla parametru z określeniem czy można wpisać własną wartość lub wybrać funkcję, czy zmienną. Wydaje mi się, że będzie to mieć sens tylko dla parametrów o podstawowych typach.
  6. Możliwość filtrowania wartości, np.: dla parametru typu VARIABLE, możnaby przefiltrować jakie zmienne miałyby być wyświetlane. Np, gdy chcielibyśmy tylko zmienne typu FLOAT.
  7. Możliwość dodania zwykłego labela, chyba będzie przydatne do grupowania parametrów.
  8. Możliwość dodania checkboxa - umożliwiałby pokazywanie i ukrywanie parametrów.
  9. Możliwość definiowania sekcji, którą możnaby było zwinąć, taki fieldset zwijany.

Definicja formularza mogłaby wyglądać następująco:

buildForm: function( form ) {
	//dodanie parametru w podstawowej formie
	form.addField("parameter_id"); //parameter_id to id parametru zdefiniowanego w komponencie
	
	//dodanie parameteru ze zdarzeniem change
	form.addField({
		id: "param_id",
		onChange: function(value, options) {
			if(value) {
				form.showField("hiddenParam");	
			}
			else {
				form.hideField("hiddenParam");
			}
		}
	});
 
	//dodanie parametru, który jest ukryty podczas inicjalizacji
	form.addField({
		id: "hiddenParam",
		hidden: true //domyślnie false
	});
}

API FORMULARZA V1 (apiVersion=1)

  1. addField(Object / parameterId) - dodaje pole parametru na ostatniej pozycji
  2. insertField(position, Object / parameterId) - dodaje pole parametru na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition)
  3. removeField(parameterId) - usuwa pole parametru
  4. hideField (parameterId) - ukrywa parametr
  5. showField(parameterId) - pokazuje parametr
  6. focusField(parameterId) - ustawia kursor w polu parametru
  7. addLabel("Label text") - dodaje etykietę na ostatniej pozycji
  8. insertLabel(position, "Label text" ) - dodaje etykietę na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition)
  9. addCheckbox(Object) - dodaje checkbox na ostatniej pozycji, obiekt definicji zawiera następujące właściwości:
    1. name - nazwa pola
    2. description - opis pola
  10. insertCheckbox(position, Object) - dodaje checkbox na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition)
  11. addCombobox(Object) - dodale listę rozwijaną na ostatniej pozycji, obiekt definicji zawiera następujące właściwości:
    1. id - identyfikator parametru typu String, który będzie w formie listy rozwijanej, jeśli id nie jest podane, parametr nie istnieje lub zmienna jest innego typu, niż string, to do formularza parametrów jest dodawana niezależna lista rozwijana
    2. text - etykieta pola
    3. value - wartość początkowa
    4. remote - informuje, czy dane listy rozwijanej mają być pobierane z serwera, czy jest to statyczna lista (domyślnie: false), gdy remote ma wartość true, to do serwera podczas pobierania danych przekazywane są następujące parametry:
      1. sort - nazwa pola, po którym dane są sortowane
      2. dir - kierunek sortowania (ASC/DESC)
      3. query - aktualnie wpisana wartość w listę rozwijaną, służy do filtrowania wartości
      4. start - offset
      5. limit - rozmiar strony
      Serwer musi zwrócić obiekt json z polami:
      1. total - całkowita liczba wyników,
      2. data - pobrane dane z uwzględnieniem stronnicowania
    5. values - lista wartości dla statycznej listy rozwijanej, właściwość jest tablicą obiektów, z których każdy posiada następujące własności
      1. id - identyfikator wartości
      2. display - nazwa wartości
      3. description - opis wartości
    6. url - url zwracający dane z serwera dla dynamnicznej listy rozwijanej, może być także w postaci funkcji zwracającej wartość typu String, która przyjmuje następujące parametry:
      1. options - dodatkowe parametry przekazywane do funkcji
        1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
    7. fields - pola, jakie są zwracane z serwera, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
      1. name - nazwa pola
      2. type - typ pola (string, boolean, integer, float, date)
    8. valueField - nazwa pola, którego wartość ma być ustawiana jako wartość parametru
    9. displayField - nazwa pola, którego wartość jest wyświetlana na liście
    10. pageSize - rozmiar strony (domyślnie: 20)
    11. template - szablon opisujący sposób wyświetlania wartości na liście, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
      1. label - etykieta dla pola
      2. field - nazwa pola
    12. sort - umozliwia określenie sortowania danych z serwera, właściwość jest obiektem, który posiada następujące własności:
      1. field - nazwa pola, po którym występuje sortowanie
      2. direction - kierunek sortowania (ASC/DESC)
    13. onChange - funkcja wykonywana po wybraniu wartości z listy, przyjmuje następujące parametry:
      1. value - wartość pola parametru
      2. options - dodatkowe parametry przekazywane do funkcji
        1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
  12. insertCombobox(position, Object) - dodale listę rozwijaną na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), obiekt definicji zawiera następujące właściwości:
    1. id - identyfikator parametru typu String, który będzie w formie listy rozwijanej, jeśli id nie jest podane, parametr nie istnieje lub zmienna jest innego typu, niż string, to do formularza parametrów jest dodawana niezależna lista rozwijana
    2. remote - informuje, czy dane listy rozwijanej mają być pobierane z serwera, czy jest to statyczna lista (domyślnie: false), gdy remote ma wartość true, to do serwera podczas pobierania danych przekazywane są następujące parametry:
      1. sort - nazwa pola, po którym dane są sortowane
      2. dir - kierunek sortowania (ASC/DESC)
      3. query - aktualnie wpisana wartość w listę rozwijaną, służy do filtrowania wartości
      4. start - offset
      5. limit - rozmiar strony
      Serwer musi zwrócić obiekt json z polami:
      1. total - całkowita liczba wyników,
      2. data - pobrane dane z uwzględnieniem stronnicowania
    3. values - lista wartości dla statycznej listy rozwijanej, właściwość jest tablicą obiektów, z których każdy posiada następujące własności
      1. id - identyfikator wartości
      2. display - nazwa wartości
      3. description - opis wartości
    4. url - url zwracający dane z serwera dla dynamnicznej listy rozwijanej, może być także w postaci funkcji zwracającej wartość typu String, która przyjmuje następujące parametry:
      1. options - dodatkowe parametry przekazywane do funkcji
        1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
    5. fields - pola, jakie są zwracane z serwera, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
      1. name - nazwa pola
      2. type - typ pola (string, boolean, integer, float, date)
    6. valueField - nazwa pola, którego wartość ma być ustawiana jako wartość parametru
    7. displayField - nazwa pola, którego wartość jest wyświetlana na liście
    8. pageSize - rozmiar strony (domyślnie: 20)
    9. template - szablon opisujący sposób wyświetlania wartości na liście, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
      1. label - etykieta dla pola
      2. field - nazwa pola
    10. sort - umozliwia określenie sortowania danych z serwera, właściwość jest obiektem, który posiada następujące własności:
      1. field - nazwa pola, po którym występuje sortowanie
      2. direction - kierunek sortowania (ASC/DESC)
    11. onChange - funkcja wykonywana po wybraniu wartości z listy, przyjmuje następujące parametry:
      1. value - wartość pola parametru
      2. options - dodatkowe parametry przekazywane do funkcji
        1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
  13. getFieldPosition(parameterId) - zwraca pozycję pola parametru, jeżeli parametr znajduje się w tabeli, to zwracana jest pozycja pola parametru tabeli
  14. getFieldValue(parameterId, asString) - zwraca wartość pola parametru, wartość może być zwrócona w postaci string (asString=true)
  15. setFieldValue(parameterId, value) - ustawia wartość pola parametru
  16. addButton(Object) - dodaje przycisk na ostatniej pozycji, obiekt definicji zawiera następujące właściwości:
    1. text - teskt przycisku
    2. iconCls - systemowa klasa css dla ikony przycisku
    3. tooltip  - tooltip przycisku
    4. handler - funkcja wykonywana po kliknięciu w przycisk
    5. scope - scope dla funkcji wykonywanej po kliknięciu w przycisk, domyślnie: window
  17. insertButton(position, Object) - dodaje przycisk na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), obiekt definicji zawiera następujące właściwości:
    1. text - teskt przycisku
    2. iconCls - systemowa klasa css dla ikony przycisku
    3. tooltip  - tooltip przycisku
    4. handler - funkcja wykonywana po kliknięciu w przycisk
    5. scope - scope dla funkcji wykonywanej po kliknięciu w przycisk, domyślnie: window
  18. addFieldToArray(parameterId) - dodaje nowe pole na ostatniej pozycji w parametrze tabelarycznym, pole nie jest dodawane do parametru tabelarycznego, który znajduje się w tabeli
  19. removeFieldFromArray(parameterId, position) - usuwa pole z danej pozycji z parametru tabelarycznego, pole nie jest usuwane z parametru tabelarycznego, który znajduje się w tabeli
  20. setFieldValueInArray(parameterId, position, value) - ustawia wartość pola na danej pozycji w parametrze tabelarycznym
  21. getArraySize(parameterId) - zwraca ilość pól w parametrze tabelarycznym lub 0, jeśli pole nie jest parametrem tabelarycznym
  22. resetArray(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 tabeli
  23. addTable([ Object / parameterId ], Object) - dodaje tabelę (zbiór pól tabelarycznych) na ostatniej pozycji, obiekt definicji tabeli (drugi parametr) zawiera następujące właściwości:
    1. tableId - identyfikator tabeli, który pozwala ukrywać/pokazywać/usuwać pole
    2. name - nazwa tabeli
    3. description - opis tabeli
    4. hidden - określa, czy tabela ma zostać ukryta
  24. insertTable(position, [ Object / parameterId ], Object) - dodaje tabelę (zbiór pól tabelarycznych) na określonej pozycji (w celu wyznaczenia position dla pola należy korzystać z funkcji getFieldPosition), obiekt definicji tabeli (drugi parametr) zawiera następujące właściwości:
    1. tableId - identyfikator tabeli, który pozwala ukrywać/pokazywać/usuwać pole
    2. name - nazwa tabeli
    3. description - opis tabeli
    4. hidden - określa, czy tabela ma zostać ukryta
  25. addDataChooserMapping(Object) - dodaje mapping data choose'a, ma znaczenie tylko dla komponentu data chooser'a, obiektmappingu zawiera następujące właściwości:
    1. id - id mappingu
    2. description - opis mappingu
    3. variableId - id zmiennej procesu, na którą jest mapowana wybrana wartość w data chooser
    4. name - tekst wyświetlany dla mappingu podczas prezentacji rezultatów data chooser'a na formularzu zadania
    5. hidden - informuje, czy mapping ma być ukryty na formularzu zadania
    6. verify - informuje, czy mapping ma być walidowany na formularzu zadania
    7. readOnly - informuje, które wartości nie mogą być edytowane w danym mappingu, akceptowane wartości to:
      1. true/false - zmienna typu boolean, informuje, że żadna z wartości mappingu nie może być edytowana
      2. string - zmienna typu string, informuje, która z wartości mappingu nie może być edytowana (akceptowane wartości to: id, description, variableId, name, hidden, verify)
      3. array - zmienna tabelaryczna, informuje, które z wartości mappingu nie mogą być edytowane (akceptowane wartości to: id, description, variableId, name, hidden, verify)
  26. resetDataChooserMappings() - usuwa wszystkie mappingi data choose'a, ma znaczenie tylko dla komponentu data chooser'a

WŁAŚCIWOŚCI POLA PARAMETRU (FIELD)

  • id,
  • onChange,
  • onBlur,
  • hidden,
  • optional,
  • notEmpty,
  • value,
  • readOnly
  • hideLabel
  • 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)
  • url - url zwracający dane z serwera dla dynamnicznej listy rozwijanej, może być także w postaci funkcji

API FORMULARZA V2 (apiVersion=2)

  1. addField(Object / parameterId, position) - dodaje pole parametru 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
  2. removeField(parameterId) - usuwa pole parametru
  3. hide (parameterId) - ukrywa parametr
  4. show(parameterId) - pokazuje parametr
  5. focusField(parameterId) - ustawia kursor w polu parametru
  6. addLabel("Label text", position) - dodaje etykietę 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
  7. addCheckbox(Object, position) - dodaje checkbox 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:
    1. id - identyfikator checkbox'a typu String, możliwe jest ustawienie wartości checkbox'a za pomocą identyfikatora
    2. name - nazwa pola
    3. description - opis pola
    4. bindedFieldId - identyfikator parametru typu logicznego, jego wartość odzwierciedla, czy checkbox jest zaznaczony, zmiana zaznaczenia checkbox'a wpływa na wartość powiązanego pola
  8. addCombobox(Object, position) - dodaje listę rozwijaną 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:
    1. id - identyfikator parametru typu String, który będzie w formie listy rozwijanej, jeśli id nie jest podane, parametr nie istnieje lub zmienna jest innego typu, niż string, to do formularza parametrów jest dodawana niezależna lista rozwijana
    2. name - etykieta pola
    3. description - opis pola
    4. value - wartość początkowa
    5. optional - informuje, czy wymagane jest podanie wartości (domyślnie: false)
    6. forceSelection - informuje, że parametr może przyjmować tylko wartości znajdujące się na liście (domyślnie: true)
    7. remote - konfiguracja pobierania danych z serwera, jej brak informuje, że dana lista jest statyczną listą (domyślnie: null), zawiera takie właściwości jak:
      1. url - url zwracający dane z serwera dla dynamnicznej listy rozwijanej, może być także w postaci funkcji, która przyjmuje następujące parametry:
        1. options - dodatkowe parametry przekazywane do funkcji
          1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
      2. fields - pola, jakie są zwracane z serwera, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
        1. name - nazwa pola
        2. type - typ pola (string, boolean, integer, float, date)
      3. remoteSort - informuje, czy sortowanie ma się odbywać po stronie serwera, czy po stronie przeglądarki (domyslnie: false - po stronie przeglądarki)
      4. pageSize - rozmiar strony (domyślnie: 25)
      Serwer musi zwrócić obiekt json z polami:
      1. total - całkowita liczba wyników,
      2. data - pobrane dane z uwzględnieniem stronnicowania
    8. values - lista wartości dla statycznej listy rozwijanej, właściwość jest tablicą obiektów, z których każdy posiada następujące własności
      1. id - identyfikator wartości
      2. display - nazwa wartości
      3. description - opis wartości
    9. valueField - nazwa pola, którego wartość ma być ustawiana jako wartość parametru
    10. displayField - nazwa pola, którego wartość jest wyświetlana na liście
    11. template - szablon opisujący sposób wyświetlania wartości na liście, właściwość jest tablicą obiektów, z których każdy posiada następujące własności:
      1. label - etykieta dla pola
      2. field - nazwa pola
    12. sort - umozliwia określenie sortowania danych z serwera, właściwość jest tablicą, który posiada obiekty o następujących własnościach:
      1. property - nazwa pola, po którym występuje sortowanie
      2. direction - kierunek sortowania (ASC/DESC)
    13. listeners - obiekt zawierający zdarzenia, obsługowane są następujące zdarzenia
      1. change - funkcja wykonywana po wybraniu wartości z listy, przyjmuje następujące parametry:
        1. value - wartość pola parametru
        2. options - dodatkowe parametry przekazywane do funkcji
          1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
      2. blur - funkcja wywoływana po wyjściu z pola, przyjmuje następujące parametry:
        1. value - wartość pola parametru
        2. options - dodatkowe parametry przekazywane do funkcji
          1. rowIndex - jeśli pole parametru jest typu tabelarycznego, to rowIndex jest pozycją aktualnego pola parametru w tablicy, pierwsza pozycja ma wartość 0
  9. getFieldPosition(parameterId) - zwraca pozycję pola parametru, jeżeli parametr znajduje się w tabeli, to zwracana jest pozycja pola parametru tabeli
  10. getValue(parameterId, asString) - zwraca wartość pola parametru, wartość może być zwrócona w postaci string (asString=true)
  11. setValue(parameterId, value) - ustawia wartość pola parametru
  12. addButton(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:
    1. id - identyfikator przycisku
    2. text - teskt przycisku
    3. iconCls - systemowa klasa css dla ikony przycisku
    4. tooltip  - tooltip przycisku
    5. handler - funkcja wykonywana po kliknięciu w przycisk
    6. scope - scope dla funkcji wykonywanej po kliknięciu w przycisk, domyślnie: window
  13. hideButton(buttonId) - ukrywa przycisk
  14. showButton(buttonId) - pokazuje przycisk
  15. addFieldToArray(parameterId) - dodaje nowe pole na ostatniej pozycji w parametrze tabelarycznym, pole nie jest dodawane do parametru tabelarycznego, który znajduje się w tabeli
  16. removeFieldFromArray(parameterId, position) - usuwa pole z danej pozycji z parametru tabelarycznego, pole nie jest usuwane z parametru tabelarycznego, który znajduje się w tabeli
  17. setFieldValueInArray(parameterId, position, value) - ustawia wartość pola na danej pozycji w parametrze tabelarycznym
  18. getArraySize(parameterId) - zwraca ilość pól w parametrze tabelarycznym lub 0, jeśli pole nie jest parametrem tabelarycznym
  19. resetArray(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 tabeli
  20. removeLastArrayFields(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 tabeli
  21. addDataChooserMapping(Object) - dodaje mapping data choose'a, ma znaczenie tylko dla komponentu data chooser'a, obiekt mappingu zawiera następujące właściwości:
    1. id - id mappingu
    2. description - opis mappingu
    3. variableId - id zmiennej procesu, na którą jest mapowana wybrana wartość w data chooser
    4. name - tekst wyświetlany dla mappingu podczas prezentacji rezultatów data chooser'a na formularzu zadania
    5. hidden - informuje, czy mapping ma być ukryty na formularzu zadania
    6. verify - informuje, czy mapping ma być walidowany na formularzu zadania
    7. readOnly - informuje, które wartości nie mogą być edytowane w danym mappingu, akceptowane wartości to:
      1. true/false - zmienna typu boolean, informuje, że żadna z wartości mappingu nie może być edytowana
      2. string - zmienna typu string, informuje, która z wartości mappingu nie może być edytowana (akceptowane wartości to: id, description, variableId, name, hidden, verify)
      3. array - zmienna tabelaryczna, informuje, które z wartości mappingu nie mogą być edytowane (akceptowane wartości to: id, description, variableId, name, hidden, verify)
  22. updateDataChooserMapping(id, Object) - edytuje mapping data choose'a na podstawie id, ma znaczenie tylko dla komponentu data chooser'a, obiekt mappingu może zawierać następujące właściwości:
    1. description - opis mappingu
    2. variableId - id zmiennej procesu, na którą jest mapowana wybrana wartość w data chooser
    3. name - tekst wyświetlany dla mappingu podczas prezentacji rezultatów data chooser'a na formularzu zadania
    4. hidden - informuje, czy mapping ma być ukryty na formularzu zadania
    5. verify - informuje, czy mapping ma być walidowany na formularzu zadania
    6. readOnly - informuje, które wartości nie mogą być edytowane w danym mappingu, akceptowane wartości to:
      1. true/false - zmienna typu boolean, informuje, że żadna z wartości mappingu nie może być edytowana
      2. string - zmienna typu string, informuje, która z wartości mappingu nie może być edytowana (akceptowane wartości to: id, description, variableId, name, hidden, verify)
      3. array - zmienna tabelaryczna, informuje, które z wartości mappingu nie mogą być edytowane (akceptowane wartości to: id, description, variableId, name, hidden, verify)
  23. removeDataChooserMapping(id) - usuwa mapping data choose'a na podstawie id, ma znaczenie tylko dla komponentu data chooser'a
  24. changeDataChooserMappingPosition(id, position) - przesuwa mapping data choose'a na podstawie id, position zaczyna się od 0 i nie może być większe niż ilość mappingów - 1, ma znaczenie tylko dla komponentu data chooser'a
  25. getAllDataChooserMapping() - zwraca wszystkie mappingi data choose'a, ma znaczenie tylko dla komponentu data chooser'a, każdy obiekt mappingu zawiera następujące właściwości:
    1. id - id mappingu
    2. description - opis mappingu
    3. variableId - id zmiennej procesu, na którą jest mapowana wybrana wartość w data chooser
    4. name - tekst wyświetlany dla mappingu podczas prezentacji rezultatów data chooser'a na formularzu zadania
    5. hidden - informuje, czy mapping ma być ukryty na formularzu zadania
    6. verify - informuje, czy mapping ma być walidowany na formularzu zadania
    7. readOnly - informuje, które wartości nie mogą być edytowane w danym mappingu, akceptowane wartości to:
      1. true/false - zmienna typu boolean, informuje, że żadna z wartości mappingu nie może być edytowana
      2. string - zmienna typu string, informuje, która z wartości mappingu nie może być edytowana (akceptowane wartości to: id, description, variableId, name, hidden, verify)
      3. array - zmienna tabelaryczna, informuje, które z wartości mappingu nie mogą być edytowane (akceptowane wartości to: id, description, variableId, name, hidden, verify)
  26. resetDataChooserMappings() - usuwa wszystkie mappingi data choose'a, ma znaczenie tylko dla komponentu data chooser'a
  27. addTable(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:
    1. id - identyfikator tabeli, który pozwala ukrywać/pokazywać/usuwać pole
    2. name - nazwa tabeli
    3. description - opis tabeli
    4. hidden - określa, czy tabela ma zostać ukryta
    5. blocked - określa, czy pojawią się przyciski dodawania/usuwania wierszy w utworzonej tabeli, domyślnie: false
    6. notEmpty - określa, czy wszystkie pola w tabeli muszą mieć dodany przynajmniej jeden wiersz
      Metoda zwraca API tabeli, które posiada następujące operacje:
      1. 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 pozycji
      2. 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 8.
      3. 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:
        1. id - identyfikator pola tablicowego
        2. value - wartość pola
      4. removeRow(position) - usuwa wiersz tabeli na określonej pozycji, parametr position jest opcjonalny, jeśli nie jest podany, to obiekt jest usuwany z ostatniej
      5. clear - czyści zawartość tabeli
  28. 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.)
  29. disable(parameterId) - blokuje pole parametru
  30. enable(parameterId) - odblokowuje pole parametru
  31. resetValue(parameterId, silent) - usuwa wartość pola parametru, jeżeli silent ma wartość true, to po zmianie wartości nie jest wykonywana funkcja onChange
  32. 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 pola
  33. hasVariableArrayValue(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 pola
  34. 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 pola
  35. setNotEmpty(parameterId, notEmpty) - pozwala ustawić wartość właściwości notEmpty
  36. setErrorHandling(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ści:
    1. type - typu string, doopuszczalne wartości to STOP i CONTINUE
    2. comment - typu string lub obiekt pobrany bezpośrednio jako wartość innego parametru
    3. userMessage - typu string lub obiekt pobrany bezpośrednio jako wartość innego parametru
    4. addErrorToComment - typu boolean lub obiekt pobrany bezpośrednio jako wartość innego parametru
    5. setters - obiekt zawierający następujące właściwości:
      1. variables - tablica identyfikatorów zmiennych, wartości typu string lub obiekt pobrany bezpośrednio jako wartość innego parametru
      2. values - tablica wartości zmiennych, wartości typu string lub obiekt pobrany bezpośrednio jako wartość innego parametru
  37. block(parameterId) - blokuje możliwość zmiany rozmiaru pola tablicowego i tabelatycznego (ukrywa przyciski dodawania/usuwania pól)
  38. unblock(parameterId) - odblokowuje możliwość zmiany rozmiaru pola tablicowego i tabelatycznego (pokazuje przyciski dodawania/usuwania pól)
  39. 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 pozycji
  40. addFieldSet(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:
    1. id - identyfikator zgrupowanego zestawu pól
    2. title - tytuł zgrupowanego zestawu pól
    3. collapsible - określa, czy zgrupowany zestaw pól może być zwijany i rozwijany, domyślnie: false
    4. collapsed - określa, czy zgrupowany zestaw pól jest początkowo zwinięty, domyślnie: false
  41. collapseFieldSet(id) - zwija zgrupowany zestaw pól
  42. expandFieldSet(id) - rozwija zgrupowany zestaw pól
  43. toggleFieldSet(id) - zmienia stan zgrupowanego zestawu pól w zależności od tego, czy jest on zwinięty/rozwinięty
  44. addColorPicker(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 STRING
  45. isDataChooserInTable(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 lista
  46. activateRebuildParameters() - aktywuje przebudowanie dynamicznego formularza parametrów po wystąpieniu następujących zdarzeń
    1. zmiana położenia zmiennej procesu typu dynamiczna lista
  47. deactivateRebuildParameters() - dezaktywuje przebudowanie dynamicznego formularza parametrów po wystąpieniu następujących zdarzeń
    1. zmiana położenia zmiennej procesu typu dynamiczna lista
  48. showMessage(Object) - wyświetla wiadomość w pop-up'ie z przyciskiem OK, obiekt konfiguracji zawiera następujące właściwości:
    1. message - treść wiadomości
    2. title - tytuł okna
  49. 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:
    1. id - identyfikator definicji zadania
    2. name - nazwa zadania
  50. 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:
    1. id - identyfikator roli
    2. name - nazwa roli
  51. getAllVariables - zwraca listę wszystkich zmiennych, które aktualnie występują w procesie. Obiekt każdej tabeli na liście posiada następujące właściwości:
    1. id - identyfikator zmiennej
    2. name - nazwa zmiennej
    3. type - typ zmiennej

      Typ zmiennejWartość przekazywana
      TekstowySTRING
      Pole tekstoweTEXTAREA
      Data i czasDATETIME
      DatowyDATE
      CałkowityINTEGER
      ZmiennoprzecinkowyFLOAT
      LogicznyBOOLEAN
      KwotowyAMOUNT
      Przycisk jednokrotnego wyboruRADIOBUTTON
      Przycisk wyboru (checkbox)CHECKBOX
      Lista wartościLISTBOX
      Tabela użytkowników systemuUSERLIST
      Lista użytkowników systemuUSERLISTLISTBOX
      Filtrowana lista użytkowników o roliROLEUSERS
      Lista użytkowników o roliROLEUSERS_NO_FILTER
      Dynamiczna listaDATA_CHOOSER
    4. destination - położenie zmiennej

      Umiejscowienie zmiennejWartość przekazywana
      Formularzform
      Tabelatable
  52. 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:
    1. id - identyfikator tabeli
    2. name - nazwa (tytuł) tabeli
    3. columns - lista identyfikatorów zmiennych procesu, które zostały użyte jako kolumny tabeli
  53. 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:
    1. id - identyfikator tabeli
    2. name - nazwa (tytuł) tabeli
    3. columns - lista identyfikatorów zmiennych procesu, które zostały użyte jako kolumny tabeli
  54. showHint(parameterId, hint, type) - wyświetla podpowiedź pod danym parametrem/tabelą. Funkcja przyjmuje następujące parametry:
    1. parameterId - identyfikator parametru, może być też identyfikatorem tabeli
    2. hint - treść podpowiedzi
    3. type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
      1. INFO - czarny
      2. SUCCESS - zielony
      3. ERROR - czerwony
  55. showHintInArray(parameterId, position, hint, type) - wyświetla podpowiedź pod danym polem w parametrze tabelarycznym. Funkcja przyjmuje następujące parametry:
    1. parameterId - identyfikator parametru, może być też identyfikatorem tabeli
    2. position - indeks parametru w tabeli
    3. hint - treść podpowiedzi
    4. type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
      1. INFO - czarny
      2. SUCCESS - zielony
      3. ERROR - czerwony
  56. hideHint(parameterId) - ukrywa podpowiedź pod danym parametrem/tabelą
  57. hideHintInArray(parameterId, position) - ukrywa podpowiedź pod danym polem w parametrze tabelarycznym


Combobox API:

  1. addValues(Object/Array) - dodaje do listy rozwijanej kolejne pozycje (patrz values w metodzie addCombobox), dotyczy tylko tych list rozwijanych, które działają lokalnie
  2. setValues(Object/Array) - zmienia pozycje na liście rozwijanej (patrz values w metodzie addCombobox), dotyczy tylko tych list rozwijanych, które działają lokalnie
  3. 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 String
  4. setForceSelection(forceSelection) - ustawia wartość pola forceSelection

WŁAŚCIWOŚCI POLA PARAMETRU (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ść 0
    • change
    • blur
    • select (dla listy rozwijanej)
    • addfield (dla pola typu tablicowego, parametrem jest pozycja pola)
  • 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)

WALIDACJA FORMULARZA

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:

  1. confirm: true - wyświetla okno wymagające potwierdzenia kontynuwacji zapisu, dodatkowe właściwości obiektu to:
    1. title - tytuł okna potwierdzenia (domyślnie: Uwaga)
    2. message - wiadomość wyświetlona w oknie potwierdzenia

{
  confirm: true,
  title: 'Potwierdź zapis',
  message: 'Czy chcesz kontynuować zapis?'
}

 

API dostarczone jako parametr metody umożliwia korzystanie z następujących funkcji:

  1. getFieldPosition(parameterId) - zwraca pozycję pola parametru, jeżeli parametr znajduje się w tabeli, to zwracana jest pozycja pola parametru tabeli
  2. getValue(parameterId, asString) - zwraca wartość pola parametru, wartość może być zwrócona w postaci string (asString=true)
  3. getArraySize(parameterId) - zwraca ilość pól w parametrze tabelarycznym lub 0, jeśli pole nie jest parametrem tabelarycznym
  4. 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 pola
  5. 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 pola
  6. 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 pola
  7. 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ów
  8. 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ów
  9. 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 pola
  10. showErrorMessage(errorMessage) - wyświetla komunikat błędu
  11. showHint(parameterId, hint, type) - wyświetla podpowiedź pod danym parametrem/tabelą. Funkcja przyjmuje następujące parametry:
    1. parameterId - identyfikator parametru, może być też identyfikatorem tabeli
    2. hint - treść podpowiedzi
    3. type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
      1. INFO - czarny
      2. SUCCESS - zielony
      3. ERROR - czerwony
  12. showHintInArray(parameterId, position, hint, type) - wyświetla podpowiedź pod danym polem w parametrze tabelarycznym. Funkcja przyjmuje następujące parametry:
    1. parameterId - identyfikator parametru, może być też identyfikatorem tabeli
    2. position - indeks parametru w tabeli
    3. hint - treść podpowiedzi
    4. type - typ podpowiedzi (odpowiada za kolor tekstu), dostępne wartości to:
      1. INFO - czarny
      2. SUCCESS - zielony
      3. ERROR - czerwony
  13. hideHint(parameterId) - ukrywa podpowiedź pod danym parametrem/tabelą
  14. hideHintInArray(parameterId, position) - ukrywa podpowiedź pod danym polem w parametrze tabelarycznym

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:

  1. destination - available only for the form action, it informs what form component the action is added to, available values are:
    1. FORM - form
    2. VARIABLE - variable
    3. VARIABLESET - dynamic table
    4. BUTTON - button
    5. DT_BUTTON - dynamic table button
  2. acceptButton - takes the value true if the action is added to the accept button
  3. tableId - identifier of the dynamic table (holds a value when destination takes the value VARIABLESET or DT_BUTTON)
  4. 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:

  1. buildForm - a function that builds a form of parameters
  2. toText - a function that returns a more readable representation, it takes parameters:
    1. 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.
    2. 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:
      1. type - he name of the parameter type, e.g. string, integer, date, etc.
      2. array - true or false, indicates whether the parameter is of array type
  3. 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:

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( ', ' ) + ' )';
						}
					} );

 

Assumptions

  1. Ability to deploy parameters in a fairly customized way.
  2. Ability to plug events into parameter fields:
    1. change
    2. blur
  3. 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
  4. Hiding / showing parameters.
  5. 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.

  6. 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.
  7. Ability to add a simple label, I guess it will be useful for grouping parameters.
  8. Ability to add a checkbox - would allow to show and hide parameters.
  9. Ability to define a section that could be collapsed, such a collapsible fieldset.

The form definition might look as follows:

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
	});
}

FORM API V1 (apiVersion=1)

  1. addField(Object / parameterId) - adds a parameter field at the last position
  2. insertField(position, Object / parameterId) - adds a parameter field at the specified position (use the getFieldPosition function to determine the position for the field)
  3. removeField(parameterId) - removes the parameter field
  4. hideField (parameterId) - hides the parameter field
  5. showField(parameterId) - shows the parameter
  6. focusField(parameterId) - sets the cursor in the parameter field
  7. addLabel("Label text") - adds a label at the last position
  8. insertLabel(position, "Label text" ) - adds a label at the specified position (use the getFieldPosition function to determine the position for a field)
  9. addCheckbox(Object) - adds a checkbox at the last position, the definition object contains the following properties:
    1. name - the name of the field
    2. description - description of the field
  10. insertCheckbox(position, Object) - adds a label at the specified position (use the getFieldPosition function to determine the position for the field)
  11. addCombobox(Object) - adds a checkbox at the last position, the definition object contains the following properties:
    1. 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
    2. text - the label of the field
    3. value - the initial value
    4. 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:
      1. sort - name of the field by which the data are sorted
      2. dir - direction of sorting (ASC/DESC)
      3. query - currently entered value in the drop-down list, used to filter values
      4. start - offset
      5. limit - page size
      The server must return a json object with fields:
      1. total - the total number of results
      2. data - downloaded data including paging
    5. 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
      1. id - identifier of the value
      2. display - name of the value
      3. description - description of the value
    6. 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:
      1. options - additional parameters passed to the function
        1. 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
    7. fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
      1. name - the name of the field
      2. type - field type (string, boolean, integer, float, date)
    8. valueField - the name of the field whose value is to be set as a parameter value
    9. displayField - the name of the field whose value is displayed in the list
    10. pageSize - the size of the page (default: 20)
    11. 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:
      1. label - label for a field
      2. field - name of the field
    12. sort - allows you to specify the sorting of data from the server, the property is an object that has the following properties:
      1. field - the name of the field followed by sorting
      2. direction - sorting direction (ASC/DESC)
    13. onChange - a function executed after selecting a value from the list, it takes the following parameters:
      1. value - the value of the parameter field
      2. options - additional parameters passed to the function
        1. 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
  12. 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:
    1. 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
    2. 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:
      1. sort - the name of the field by which the data is sorted
      2. dir - sorting direction (ASC/DESC)
      3. query - currently entered value in drop-down list, used to filter values
      4. start - offset
      5. limit - page size
      The server must return a json object with fields:
      1. total - the total number of results
      2. data - downloaded data including paging
    3. 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
      1. id - the identifier of the value
      2. display - the name of the value
      3. description - description of the value
    4. 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:
      1. options - dditional parameters passed to the function
        1. 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
    5. fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
      1. name - the name of the field
      2. type - the type of the field (string, boolean, integer, float, date)
    6. valueField - the name of the field which value is to be set as a parameter value
    7. displayField - the name of the field which value is to be displayed in the list
    8. pageSize - the size of the page (default: 20)
    9. 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:
      1. label - a label for the field
      2. field - the name of the field
    10. sort - allows to specify sorting of data from the server, the property is an object that has the following properties:
      1. field - name of the field followed by sorting
      2. direction - sorting direction (ASC/DESC)
    11. onChange - a function executed after selecting a value from the list, it takes the following parameters:
      1. value - the value of the parameter field
      2. options - additional parameters passed to the function
        1. 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
  13. 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
  14. getFieldValue(parameterId, asString) -  returns the value of the parameter field, the value can be returned as a string (asString=true)
  15. setFieldValue(parameterId, value) - sets the value of the parameter field
  16. addButton(Object) - adds a button on the last position, the definition object contains the following properties:
    1. text - the text of the button
    2. iconCls - system css class for button icon
    3. tooltip  - button tooltip
    4. handler - function executed after clicking the button
    5. scope - scope for the function executed after clicking the button, default: window
  17. 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:
    1. text - the text of the button
    2. iconCls - system css class for button icon
    3. tooltip  - button tooltip
    4. handler - function executed after clicking the button
    5. scope - scope for the function executed after clicking the button, default: window
  18. 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
  19. 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
  20. setFieldValueInArray(parameterId, position, value) - sets the value of the field at the given position in the tabular parameter
  21. getArraySize(parameterId) - returns the number of fields in the table parameter, or 0 if the field is not a table parameter
  22. 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
  23. 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:
    1. tableId - identifier of the table to hide/show/remove the field
    2. name - the name of the table
    3. description - description of the table
    4. hidden - specifies whether the table is to be hidden
  24. 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:
    1. tableId - identifier of the table, which allows you to hide/show/remove the field
    2. name - the name of the table
    3. description - description of the table
    4. hidden - specifies whether the table is to be hidden
  25. addDataChooserMapping(Object) - adds data chooser mapping, is relevant only for the data chooser component, the mapping object contains the following properties:
    1. id - mapping id
    2. description - mapping description
    3. variableId - id of the process variable to which the selected value in the data chooser is mapped
    4. name - text displayed for mapping during the presentation of data chooser results on the task form
    5. hidden - informs whether the mapping is to be hidden on the task form
    6. verify - informs whether the mapping is to be validated on the task form
    7. readOnly - informs which values cannot be edited in a given mapping, accepted values are:
      1. true/false - boolean variable, informs that none of the mapping values can be edited
      2. 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)
      3. array - tabular variable, informs which mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
  26. resetDataChooserMappings() - removes all data choose mappings, only relevant for the data chooser component

PARAMETER FIELD PROPERTIES (FIELD)

  • 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

FORM API V2 (apiVersion=2)

  1. 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
  2. removeField(parameterId) - removes the parameter field
  3. hide (parameterId) - hides the parameter
  4. show(parameterId) - shows the parameter
  5. focusField(parameterId) - places the cursor in the parameter field
  6. 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
  7. 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:
    1. id - checkbox identifier of String type, it is possible to set checkbox value with identifier
    2. name - name of the field
    3. description - description of the field
    4. 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
  8. 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:
    1. 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
    2. name - the label of the field
    3. description - the description of the field
    4. value - initial value
    5. optional - indicates whether the value is required (default: false)
    6. forceSelection - informs that the parameter can only accept values in the list (default: true)
    7. remote - configuration for downloading data from the server, its absence informs that the list is a static list (default: null), contains such properties as:
      1. 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:
        1. options - additional parameters transferred to the function
          1. 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
      2. fields - the fields that are returned from the server, the property is an array of objects, each of which has the following properties:
        1. name - the name of the field
        2. type - the type of the field (string, boolean, integer, float, date)
      3. remoteSort - indicates whether the sorting is to be done on the server side or on the browser side (default: false - on the browser side)
      4. pageSize - the size of the page (default: 25)
      The server must return a json object with fields:
      1. total - the total number of results
      2. data - downloaded data including paging
    8. 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
      1. id - the identifier of the value
      2. display - the name of the value
      3. description - description of the value
    9. valueField - the name of the field whose value is to be set as a parameter value
    10. displayField - the name of the field whose value is displayed in the list
    11. 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:
      1. label - a label for the field
      2. field - the name of the field
    12. sort - allows to define the sorting of data from the server, the property is an array of objects, each having the following properties:
      1. property - the name of the field followed by sorting
      2. direction - sorting direction (ASC/DESC)
    13. listeners - object containing events, the following events are supported
      1. change - function executed after selecting a value from the list, accepts the following parameters:
        1. value - the value of the parameter field
        2. options - additional parameters passed to the function
          1. 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
      2. blur - the function called when the field is exited, it accepts the following parameters:
        1. value - the value of the parameter field
        2. options - additional parameters passed to the function
          1. 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
  9. 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
  10. getValue(parameterId, asString) - returns the value of the parameter field, the value can be returned as a string (asString=true)
  11. setValue(parameterId, value) - sets the value of the parameter field
  12. addButton(Object, position) - adds 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:
    1. id - button id
    2. text - the text of the button
    3. iconCls - system css class for button icon
    4. tooltip  - buttontooltip
    5. handler - function executed after clicking the button
    6. scope - scope for the function executed after clicking the button, default: window
  13. hideButton(buttonId) - hides button
  14. showButton(buttonId) - shows button
  15. addFieldToArray(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 table
  16. removeFieldFromArray(parameterId, position) - removes the field at the given position from the tabular parameter, the field is not removed from the tabular parameter that is in the table
  17. setFieldValueInArray(parameterId, position, value) - sets the value of the field at the given position in the tabular parameter
  18. getArraySize(parameterId) -  returns the number of fields in the table parameter or 0 if the field is not a table parameter
  19. 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
  20. removeLastArrayFields(parameterId, amount) - removes 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 table
  21. addDataChooserMapping(Object) - adds data chooser mapping, it is relevant only for data chooser component, mapping object contains the following properties:
    1. id - mapping id
    2. description - mapping description
    3. variableId - id of the process variable, to which the selected value in data chooser is mapped
    4. name - the text displayed for the mapping when presenting the data chooser results on the task form
    5. hidden - indicates whether the mapping is to be hidden on the task form
    6. verify - indicates whether the mapping is to be validated on the task form
    7. readOnly - informs which values cannot be edited in a given mapping, accepted values are:
      1. true/false - variable of boolean type, indicates that none of the mapping values can be edited
      2. string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
      3. array - a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
  22. updateDataChooserMapping(id, Object) - updates data chooser mapping by id, it is relevant only for data chooser component, mapping object can contain the following properties:
    1. description - mapping description
    2. variableId - id of the process variable, to which the selected value in data chooser is mapped
    3. name - the text displayed for the mapping when presenting the data chooser results on the task form
    4. hidden - indicates whether the mapping is to be hidden on the task form
    5. verify - indicates whether the mapping is to be validated on the task form
    6. readOnly - informs which values cannot be edited in a given mapping, accepted values are:
      1. true/false - variable of boolean type, indicates that none of the mapping values can be edited
      2. string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
      3. array - a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
  23. removeDataChooserMapping(id) - removes data chooser mapping by id, it is relevant only for data chooser component
  24. changeDataChooserMappingPosition(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 component
  25. getAllDataChooserMappings() - returns list of all data chooser mappings, it is relevant only for data chooser component, each mapping object contains the following properties:
    1. id - mapping id
    2. description - mapping description
    3. variableId - id of the process variable, to which the selected value in data chooser is mapped
    4. name - the text displayed for the mapping when presenting the data chooser results on the task form
    5. hidden - indicates whether the mapping is to be hidden on the task form
    6. verify - indicates whether the mapping is to be validated on the task form
    7. readOnly - informs which values cannot be edited in a given mapping, accepted values are:
      1. true/false - variable of boolean type, indicates that none of the mapping values can be edited
      2. string - variable of type string, indicates which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
      3. array - a table variable, informs which of the mapping values cannot be edited (accepted values are: id, description, variableId, name, hidden, verify)
  26. resetDataChooserMappings() - removes all data chooser mappings, only relevant for data chooser component
  27. addTable(Object, position) - 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:
    1. id - identifier of the table to hide/show/remove the field
    2. name - the name of the table
    3. description - description of the table
    4. hidden - determines whether the table is to be hidden
    5. blocked - determines whether buttons for adding/removing rows in the created table will appear, default: false
    6. notEmpty - determines whether all fields in the table must have at least one row added
      1. addField(Object / parameterId, position) - adds a table parameter field at the specified position, the position parameter is optional, if not specified, the object is added at the last position
      2. addCombobox(Object, position) - 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.
      3. addRow([ Object ], position) - 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:
        1. id - table field identifier
        2. value - the value of the field
      4. 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
      5. clear - clears the contents of the table
  28. 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.).
  29. disable(parameterId) - blocks the parameter field
  30. enable(parameterId) - unlocks the parameter field
  31. resetValue(parameterId, silent) - deletes the value of the parameter field, if silent is true, the onChange function is not executed after changing the value
  32. hasVariableValue(parameterId, position) -  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 checked
  33. hasVariableArrayValue(parameterId, position) - indicates 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 checked
  34. hasFunctionValue(parameterId, position) - indicates 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 checked
  35. setNotEmpty(parameterId, notEmpty) - allows you to set the value of the notEmpty property
  36. setErrorHandling(Object) - allows 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:
    1. type - string type, acceptable values are STOP and CONTINUE
    2. comment - string type or an object taken directly as a value of another parameter
    3. userMessage - string type or an object taken directly as the value of another parameter
    4. addErrorToComment - boolean type or an object taken directly as a value of another parameter
    5. setters - object containing the following properties:
      1. variables - an array of variable identifiers, string-type values or an object taken directly as the value of another parameter
      2. values - an array of variable values, string type values or an object taken directly as the value of another parameter
  37. block(parameterId) - blocks the ability to resize table and table fields (hides the add/remove field buttons)
  38. unblock(parameterId) - unblocks the ability to resize table and tabular fields (shows the add/remove field buttons)
  39. addEmptyLine(position) - adds 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 position
  40. addFieldSet(Object, position) - adds 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:
    1. id - identifier of the grouped set of fields
    2. title - the title of the grouped set of fields
    3. collapsible - specifies whether the grouped set of fields can be collapsed and expanded, default: false
    4. collapsed - specifies whether the grouped set of fields is initially collapsed, default: false
  41. collapseFieldSet(id) - collapses the grouped set of fields
  42. expandFieldSet(id) - expands the grouped set of fields
  43. toggleFieldSet(id) - specifies whether the grouped set of fields can be collapsed and expanded, default: false
  44. addColorPicker(Object / parameterId, position) - 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 STRING
  45. isDataChooserInTable(id) - returns 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 type
  46. activateRebuildParameters() - activates the rebuilding of the dynamic parameter form after the occurrence of the following events
    1. change of position of the process variable of the dynamic list type
  47. deactivateRebuildParameters() - deactivates the rebuilding of the dynamic parameter form after the occurrence of the following events
    1. change of position of a process variable of the dynamic list type
  48. showMessage(Object) - displays a message in a pop-up with an OK button, the configuration object contains the following properties:
    1. message - message content
    2. title - the title of the window
  49. 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:
    1. id - task definition identifier
    2. name -  name of the task
  50. 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:
    1. id - role identifier
    2. name - the name of the role
  51. 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:
    1. id - variable identifier
    2. name - variable name
    3. type - variable type

      Variable typeValue passed
      StringSTRING
      Text areaTEXTAREA
      Date and timeDATETIME
      DateDATE
      IntegerINTEGER
      FloatFLOAT
      BooleanBOOLEAN
      AmountAMOUNT
      RadiobuttonRADIOBUTTON
      CheckboxCHECKBOX
      ListboxLISTBOX
      System users tableUSERLIST
      System users listUSERLISTLISTBOX
      Filtered users list with roleROLEUSERS
      Filtered users list with roleROLEUSERS_NO_FILTER
      Data chooser
      DATA_CHOOSER
    4. destination - variable placement

      Variable placementValue passed
      Formform
      Tabletable
  52. 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:
    1. id - table identifier
    2. name - name (title) of the table
    3. columns - a list of identifiers of process variables, which were used as table columns
  53. 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:
    1. id - table identifier
    2. name - name (title) of the table
    3. columns - a list of identifiers of process variables, which were used as table columns
  54. showHint(parameterId, hint, type) - displays a hint under the given parameter/table. The function takes the following parameters:
    1. parameterId - parameter identifier, it can also be a table identifier
    2. hint - the content of the hint
    3. type - type of hint (responsible for the color of the text), available values are:
      1. INFO - black
      2. SUCCESS - green
      3. ERROR - red
  55. showHintInArray(parameterId, position, hint, type) - displays a hint under the given field in the table parameter. The function takes the following parameters:
    1. parameterId - parameter identifier, it can also be a table identifier
    2. position - index of the parameter in the table
    3. hint - the content of the hint
    4. type - type of hint (responsible for the color of the text), available values are:
      1. INFO - black
      2. SUCCESS - green
      3. ERROR - red
  56. hideHint(parameterId) - hides the hint under the given parameter/table
  57. hideHintInArray(parameterId, position) - hides the hint under the given field in the table parameter


Combobox API:

  1. addValues(Object/Array) - adds more positions to the drop-down list (see values in the addCombobox method), applies only to those drop-down lists that work locally
  2. setValues(Object/Array) - changes positions in the drop-down list (see values in the addCombobox method), applies only to those drop-down lists that work locally
  3. setUrl(url) - 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
  4. setForceSelection(forceSelection) - sets the value of the forceSelection field

WŁAŚCIWOŚCI POLA PARAMETRU (FIELD)

  • id
  • name
  • description
  • type
  • listeners
    • afterrender - 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 (for a drop-down list)
    • addfield (for an table-type field, the parameter is the position of the field)
  • hidden
  • disabled
  • optional
  • notEmpty
  • value
  • readOnly
  • hideLabel
  • disableVariableDuplication - 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)

FORM VALIDATION

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:

  1. confirm: true - displays a window requiring confirmation to continue saving, additional properties of the object are:
    1. title - title of the confirmation window (default: Attention)
    2. message - the message displayed in the confirmation window

{
  confirm: true,
  title: 'Confirm saving',
  message: 'Do you want to continue saving?'
}

 

The API provided as a method parameter allows you to use the following functions:

  1. 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
  2. getValue(parameterId, asString) - returns the value of the parameter field, the value can be returned as a string (asString=true)
  3. getArraySize(parameterId) - returns the number of fields in the table parameter or 0 if the field is not a table parameter
  4. hasVariableValue(parameterId, position) - indicates 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
  5. hasVariableArrayValue(parameterId, position) - indicates 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
  6. hasFunctionValue(parameterId, position) - indicates 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
  7. getFunctionReturnType(parameterId, position) - returns 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
  8. getVariableType(parameterId, position) - returns 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
  9. markError(parameterId, position) - marks 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
  10. showErrorMessage(errorMessage) - displays an error message
  11. showHint(parameterId, hint, type) - displays a hint under the given parameter/table. The function accepts the following parameters:
    1. parameterId - parameter identifier, it can also be a table identifier
    2. hint - the content of the hint
    3. type - type of hint (responsible for the color of the text), available values are:
      1. INFO - blak
      2. SUCCESS - green
      3. ERROR - red
  12. showHintInArray(parameterId, position, hint, type) - displays a hint under the given field in the table parameter. The function takes the following parameters:
    1. parameterId - identifier of the parameter, it can also be an identifier of the table
    2. position - index of the parameter in the table
    3. hint - the content of the hint
    4. type - type of hint (responsible for the color of the text), available values are:
      1. INFO - black
      2. SUCCESS - green
      3. ERROR - red
  13. hideHint(parameterId) - hides the hint under the given parameter/table
  14. hideHintInArray(parameterId, position) - hides the hint under the given field in the table parameter
 

STRING
updateDataChooserMapping