Versions Compared

Key

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

Polish

Serwis FormService pozwala na wykonywanie podstawowych operacji na formularzu. Posiada następujące funkcje:

  • refresh - odświeża formularz aktualnie wykonywanego zadania poprzez odświeżenie okna przeglądarki.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 

  • save - zapisuje zmienne formularza (zmienne do edycji, zmienne ukryte, edytowalne tabele dynamiczne). Umożliwia wykonanie określonych akcji po zakończeniu zapisu w zależności od statusu odpowiedzi. 

 

Info

Zapis formularza jest wywoływany asynchronicznie.

 

    • Parametry funkcji


NazwaTyp

Wartość domyślna

Opis
configObject{ }

Konfiguracja zapisu formularza. Obiekt posiada następujące właściwości:

    - submitMessage (Typ String)

        Treść wiadomości widocznej podczas trwania zapisu formularza (domyślnie: '')

    - scope (Typ Object)

        Scope dla opcjonalnych funkcji wykonywanych po zapisie określonych we właściwościach success i failure (domyślnie: window)

    - success (Typ Function)

        Opcjonalna funkcja wykonywana po zapisie zakończonym sukcesem (domyślnie: null)

    - successParams (Typ Object[])

        Tablica określająca parametry przekazywane do funkcji określonej we właściwości success (domyślnie: [form, action] - standardowy rezultat funkcji success dla wysyłania formy)

    - failure (Typ Function)

        Opcjonalna funkcja wykonywana po zapisie zakończonym niepowodzeniem (domyślnie: null)

    - failureParams (Typ Object[])

        Tablica określająca parametry przekazywane do funkcji określonej we właściwości failure (domyślnie: [form, action] - standardowy rezultat funkcji failure dla wysyłania formy)

    - actionInProgressMessage (Typ String)

        Określa wiadomość, jaka ma zostać wyświetlona w ostrzeżeniu, gdy nie można zapisać formularza, gdyż wykonywane są dowolne akcje, na których zakończenie należy poczekać (domyślnie: Form action in progress)


    • Rezultat funkcji: brak

  • accept - akceptuje zadanie symulując kliknięcie w wybrany przycisk akceptacji.

     

    Info

    Akceptacja formularza jest wywoływana asynchronicznie. Opcjonalne funkcje są wywoływane po operacji wysłania danych z formularza do serwera.

     

    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      configObject{ }

      Konfiguracja akceptacji formularza. Obiekt posiada następujące właściwości:

          - actionName (Typ String)

              Parametr konfiguracyjny actionName z definicji przycisku akceptacji (ACTION_ACCEPT_BUTTON) (domyślnie: null)

          - scope (Typ Object)

              Scope dla opcjonalnych funkcji wykonywanych po zapisie określonych we właściwościach success i failure (domyślnie: window)

          - success (Typ Function)

              Opcjonalna funkcja wykonywana po zapisie zakończonym sukcesem (domyślnie: null)

          - successParams (Typ Object[])

              Tablica określająca parametry przekazywane do funkcji określonej we właściwości success (domyślnie: [form, action] - standardowy rezultat funkcji success dla wysyłania formy)

          - failure (Typ Function)

              Opcjonalna funkcja wykonywana po zapisie zakończonym niepowodzeniem (domyślnie: null)    . UWAGA: zdefiniowanie tego parametru spowoduje ukrycie komunikatów walidacji (zdefiniowanych walidatorów na przycisku). Zalecane jest korzystanie z tego parametru tylko w uzasadnionych przypadkach. Komunikaty walidatrów najczęściej są ważniejsze.

          - failureParams (Typ Object[])

              Tablica określająca parametry przekazywane do funkcji określonej we właściwości failure (domyślnie: [form, action] - standardowy rezultat funkcji failure dla wysyłania formy)

          - directAccept (Typ Boolean)

              Określa, czy przejść do bezpośredniej akceptacji zadania, tj. z pominięciem sprawdzenia wykonywania AUTO_UPDATE, jsAction, ADDITIONAL_JS_CHECK (domyślnie: false)


    • Rezultat funkcji: brak

 

  • mask - maskuje formularz uniemożliwiając klikanie i wypełnianie pól.

 

    • Parametry funkcji


NazwaTyp

Wartość domyślna

Opis
messageStringnullInformacja wyświetlona na środku maski


 

    • Rezultat funkcji: brak

 

  • unmask - usuwa maskę formularza umożliwiając klikanie i wypełnianie pól.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 

  • refreshDocuments (od wersji 3.2.59) - odświeża dokumenty na formularzu bez przeładowania strony. Odświeżana jest tabela z dokumentami w zakładce Dokumenty, liczba dokumentów w tytule zakładki Dokumenty oraz widok dokumentów.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 


  • getValues - pobiera obiekt zawierający wszystkie wartości zmiennych z formularza w formie pary <klucz, wartość> postaci <id_zmiennej, wartosc_zmiennej>.
    • Parametry funkcji: brak

       

    • Rezultat funkcji

      TypOpis
      ObjectObiekt zawierający wartości zmiennych
  • getVariablesInfo - pobiera obiekt zawierający informacje o wszystkich zmiennych z formularza w formie pary <klucz, wartość> postaci <id_zmiennej, informacje_o_zmiennej>.
    • Parametry funkcji: brak

       

    • Rezultat funkcji

      TypOpis
      Object

      Obiekt zawierający informacje o zmiennych formularza. Obiekt posiada następujące właściwości:

          - editable (Typ Boolean)

              Informuje, czy zmienna jest edytowalna

          - hidden (Typ Boolean)

              Informuje, czy zmienna jest ukryta

          - readOnly (Typ Boolean)

              Informuje, czy zmienna jest tylko do odczytu

          - inVariableSet (Typ Boolean)

              Informuje, cze zmienna znajduje się w tabeli dynamicznej


  • showAddDocumentsFromDiscForm - wyświetla okno podłączania dokumentów z dysku do procesu (taki sam panel, jak w zakładce Dokumenty procesu).
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • showAddDocumentsFromArchiveForm - wyświetla okno podłączania dokumentów z archiwum do procesu (taki sam panel, jak w zakładce Dokumenty procesu).
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • showAddDocumentsFromTemplateForm - wyświetla okno podłączania dokumentów za pomocą szablonu do procesu (taki sam panel, jak w zakładce Dokumenty procesu).
    • Parametry funkcji: brak

       

    • Rezultat funkcji: brak
       


  • validateComboBoxes - dokonuje walidacji wszystkich list rozwijanych na formularzu (data chooser, lista użytkowników, lista wartości itd.) oraz zaznacza te listy, które posiadają niepoprawne wartości (także w tabelach dynamicznych). Umożliwia wykonanie określonych akcji po zakończeniu walidacji w zależności od statusu odpowiedzi. 

    Info

    Walidacja list rozwijanych jest wywoływana asynchronicznie.

     

    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      configObject{ }

      Konfiguracja walidacji list rozwijanych. Obiekt posiada następujące właściwości:

      checkForm (Typ Boolean)

      Określa, czy sprawdzać wymagalność oraz restrykcje na wyrażenia regularne w listach rozwijanych (domyślnie: false)

          - submitMessage (Typ String)

              Treść wiadomości widocznej podczas trwania walidacji list rozwijanych (domyślnie: '')

          - scope (Typ Object)

              Scope dla opcjonalnych funkcji wykonywanych po walidacji określonych we właściwościach success i failure (domyślnie: window)

          - success (Typ Function)

              Opcjonalna funkcja wykonywana po walidacji zakończonej sukcesem (domyślnie: null)

          - successParams (Typ Object[])

              Tablica określająca parametry przekazywane do funkcji określonej we właściwości success (domyślnie: [form, action] - standardowy rezultat funkcji success dla wysyłania formy)

          - failure (Typ Function)

              Opcjonalna funkcja wykonywana po walidacji zakończonej niepowodzeniem (domyślnie: null)

          - failureParams (Typ Object[])

              Tablica określająca parametry przekazywane do funkcji określonej we właściwości failure (domyślnie: [form, action] - standardowy rezultat funkcji failure dla wysyłania formy)


    • Rezultat funkcji: brak


  • insertHtml - wstawia fragment kodu HTML w dowolne miejsce na formularzu.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      htmlStringnullFragment kodu HTML. W celu upodobnienia wstawionego fragmentu kodu HTML do systemu można wykorzystać następujące klasy CSS: suncode-container-underline (dodaje podkreślenie), suncode-form-label (styl dla etykiety pola), suncode-form-grey-panel (nadaje kolor tła zgodny z formularzem, klasę CSS można dodawać tylko do komponentów div). Dodatkowo, jeżeli chcemy umieścić wstawiany kod po lewej stronie formularza, należy wykorzystać jeden z następujących styli: text-align: left, float: left. Analogicznie kod HTML umieszczamy po prawej za pomocą tych samych właściwości, lecz z wartością right. Dodatkowo możemy wyrównywać komponenty za pomocą styli margin-left: Xpx i margin-right: Xpx. Kod HTML możemy wyśrodkować za pomocą połączenia styli margin-left: auto i margin-right: 0.
      variableIdStringnullIdentyfikator zmiennej formularza (zmiennej procesu) względem której następuje wstawienie fragmentu kodu HTML. Może to być także identyfikator tabeli dynamicznej. Jeżeli parametr jest pusty lub na formularzu nie istnieje zmienna o podanym identyfikatorze, to fragment kodu HTML jest wstawiany na początku/na końcu formularza (w zależności od parametru before
      beforeBooleanfalseInformuje, czy fragment kodu HTML powinien zostać wstawiony przed podaną zmienną formularza/tabelą dynamiczną. Jeżeli parametr variableId jest pusty lub na formularzu nie istnieje zmienna o podanym identyfikatorze, to fragment kodu jest wstawiany na początku/na końcu formularza, w zależności od przyjętej wartości parametru
      sameLineBooleanfalseInformuje, czy fragment kodu HTML powinien zostać wstawiony w tym samym wierszu, co podana zmienna formularza/tabela dynamiczna. Jeżeli parametr variableId jest pusty lub na formularzu nie istnieje zmienna o podanym identyfikatorze, to wartość parametru nie ma znaczenia


    • Rezultat funkcji: brak

  • hideSaveFormButton - ukrywa przycisk zapisu formularza.
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • showSaveFormButton - pokazuje przycisk zapisu formularza.
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • hideShowCommentButton (od 3.1.15) ukrywa przycisk dodania komentarza.
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • showShowCommentButton (od 3.1.15) pokazuje przycisk dodania komentarza.
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

 

  • hideButton - (3.1.13ukrywa przyciski o podanych nazwach akcji
    • Parametry funkcji:


      NazwaTypWartość domyślnaOpis
      actionNameStringnull

      Nazwa akcji (actionName) przycisku.

      Możliwe jest ukrycie wielu przycisków na raz wywołaniem - wystarczy dodać następne parametry:

      Code Block
      languagejavascript
      formService.hideButton('przyciska', 'przyciskb');
    • Rezultat funkcji: brak

 

  • showButton - (3.1.13) pokazuje przyciski o podanych nazwach akcji
    • Parametry funkcji:

       

      NazwaTypWartość domyślnaOpis
      actionNameStringnull

      Nazwa akcji (actionName) przycisku.

      Możliwe jest pokazanie wielu przycisków na raz wywołaniem - wystarczy dodać następne parametry:

      Code Block
      languagejavascript
      formService.showButton('przyciska', 'przyciskb');
    • Rezultat funkcji: brak

  • hideLabel - (3.1.24ukrywa etykiety formularza o podanych identyfikatorach

    Info

    Wtyczka PWE od wersji 2.1-SNAPSHOT z dnia 11.12.2015 nie zmienia identyfikatorów etykiet formularza. Wcześniejsze wersje generują nowe identyfikatory podczas eksportu do nowej wersji pakietu.

     

    • Parametry funkcji:


      NazwaTypWartość domyślnaOpis
      actionNameStringnull

      Identyfikator etykiety.

      Możliwe jest ukrycie wielu etykiet na raz wywołaniem - wystarczy dodać następne parametry:

      Code Block
      languagejavascript
      formService.hideLabel('etykietaa', 'etykietab');
    • Rezultat funkcji: brak

  • showLabel - (3.1.24pokazuje etykiety formularza o podanych identyfikatorach

    Info

    Wtyczka PWE od wersji 2.1-SNAPSHOT z dnia 11.12.2015 nie zmienia identyfikatorów etykiet formularza. Wcześniejsze wersje generują nowe identyfikatory podczas eksportu do nowej wersji pakietu.

    • Parametry funkcji:


      NazwaTypWartość domyślnaOpis
      actionNameStringnull

      Identyfikator etykiety.

      Możliwe jest pokazanie wielu etykiet na raz wywołaniem - wystarczy dodać następne parametry:

      Code Block
      languagejavascript
      formService.showLabel('etykietaa', 'etykietab');
    • Rezultat funkcji: brak

  • blockAcceptance - blokuje możliwość akceptacji zadania

    Info

    Po wywołaniu funkcji zostaje zablokowana możliwość akceptacji formularza. Przyciski akceptacji zostają wyszarzone (ustawione zostaje disabled: false), a przy akceptacji przez JavaScript, wyświetlany zostaje komunikat, iż nie można zaakceptować zadania. Mechanizm nie blokuje akceptacji bezpośredniej. Mechanizm jest zaimplementowany w JavaScripcie - nie ma wpływu na akceptację po stronie serwera.

    Liczba blokowań akceptacji jest zliczana, co oznacza, iż musi być tyle samo wywołań funkcji do odblokowania formularza, co blokowań.

    • Parametry funkcji: brak

    • Rezultat funkcji: brak

  • unblockAcceptance - odblokowuje możliwość akceptacji zadania
    • Parametry funkcji: brak

    • Rezultat funkcji: brak

  • isAcceptanceBlocked - sprawdza, czy akceptacja formularza jest zablokowana
    • Parametry funkcji: brak

    • Rezultat funkcji: true/false jeżeli akceptacja formularza jest zablokowana/odblokowana
English

FormService allows you to perform basic operations on the form. It has the following functions:

  • refresh - refreshes the form of the currently performed task by refreshing the browser window.
    • Function parameters: none
    •  Function result:none

  • save - saves form variables (variables to edit, hidden variables, editable dynamic tables). Allows you to perform specific actions after the end of the saving process depending on the response status.

 

Info

The form save is invoked asynchronously

 

    • Function parameters 

Name

Type

Default value

Description

config

Object

{ }

Configuration of the form registration. The object has the following properties:

    - submitMessage (Type String)

The content of the message visible during the duration of the form (default: '')        

    - scope (Type Object)

        Scope for optional functions performed after writing specified in the success and failure properties (default: window)

    - success (Type Function)

Optional function performed after successful writing (default: null)      

    - successParams (Type Object[])

An array specifying the parameters passed to the function specified in the success property (default: [form, action] - the standard result of the success function for sending the form)        

    - failure (Type Function)

Optional function performed after unsuccessful write (default: null)        

    - failureParams (Type Object[])

An array defining the parameters passed to the function defined in the failure (default: [form, action] - standard result of the failure function for sending the form)        

    - actionInProgressMessage(Type String)

Specifies the message to be displayed in the warning when the form cannot be saved, because any actions are executed, on which completion must be waited (default: Form action in progress)


  • Function result: none

 

  • accept- accepts the task by simulating a click on the selected acceptance button.

 

 

Info

Form acceptance is invoked asynchronously. Optional functions are called aftersending data from the form to the server.

 

  • Function parameters

 

Name

Type

Default value

Description

config

Object

{ }

Configuration of the form acceptance. The object has the following properties:

    - actionName (Type String)

        Configuration parameter actionName from the definition of the acceptance button (ACTION_ACCEPT_BUTTON) (by default: null)

    - scope (Type Object)

        Scope for optional functions after the saving specified in the success and failure properties (by default: window)

    - success (Type Function)

        Optional function performed after successful save (by default: null)

    - successParams (Type Object[])

        An array specifying the parameters passed to the function specified in the success property (by default: [form, action] - the standard result of the success function for sending a form)

    - failure (Type Function)

        Optional function performed after a failed entry (by default: null)

    - failureParams (Type Object[])

        An array specifying the parameters passed to the function specified in the failure property (by default: [form, action] - the standard result of the failure function for sending a form)

    - directAccept (Type Boolean)

Specifies whether to proceed to direct acceptance of the task, with bypassing the AUTO_UPDATE execution check, jsAction, ADDITIONAL_JS_CHECK (default: false)       

  • Function result: none

 

  • mask- masks the form, preventing clicking and filling in fields.

 

Function parameters

Name

Type

Default value

Description

message

String

null

Information displayed in the center of the mask

 

  • Function result: none

 

  • unmask- removes the form mask allowing you to click and fill in the fields.
    • Function parameters: none
    • Function result: none

 

  • refreshDocuments (from version 3.2.59) - refreshes documents on the form without reloading the page. The table with the documents is refreshed in the Documents tab, the number of documents in the title of the Documents tab and the document view.
    • Function parameters: none
    • Function result: none

 

  • getValues– gets an object containing all the values of variables from the form in the form of a <key, value> of the form <var_id, variable_value>.
    • Function parameters: none
    • Function result: none 

 

Type

Description

Object

An object containing variable values

 

  • getVariablesInfo- gets an object containing information about all variables from the form in the form of a <key, value> of the form <variable_id>, information_about_change>.
    • Function parameters: none
    • Function result


Type

Description

Object

An object containing information about form variables. The object has the following properties:

    - editable(Type Boolean)

   Indicates whether the variable is editable     

    - hidden(Type Boolean)

   Indicates whether the variable is hidden        

    - readOnly(Type Boolean)

Indicates whether the variable is read-only

    - inVariableSet(Type Boolean)

 Indicates that the variable is in the dynamic table

 

  • showAddDocumentsFromDiscForm- displays the window for attaching documents from the disk to the process (same panel as in the Documents tab of the process).
    • Function parameters: none
    • Function result: none

  • showAddDocumentsFromArchiveForm- displays the window for attaching documents from the archive to the process (same panel as in the Documents tab of the process).
    • Function parameters: none
    • Function result: none

  • showAddDocumentsFromTemplateForm- displays the document attach window using a template for the process (same panel as in the Process Documents tab).
    • Function parameters: none
    • Function result: none

 

  • validateComboBoxes – validates all drop-down lists on the form (data chooser, list of users, list of values, etc.) and selects those lists that have incorrect values (also in dynamic tables). Allows you to perform specific actions after completing the validation depending on the response status.

 

Info

Validation of drop-down lists is called asynchronously


    • Function parameters:

 

Name

Type

Default Value

Description

config

Object

{ }

Configuration of validation of drop-down lists. The object has the following properties:

checkForm(Type Boolean)

Specifies whether to check the requirements and restrictions on regular expressions in dropdowns (default: false)

    - submitMessage(Type String)

Contents of the message visible during the validation of drop-down lists (default: '')

    - scope (Type Object)

Scope for optional functions performed after validation specified in the success and failure properties (default: window)     

    - success(Type Function)

Optional function performed after validation completed successfully (default: null)   

    - successParams(Type Object[])

An array specifying the parameters passed to the function specified in the success property (default: [form, action] - the standard result of the success function for sending the form) 

    - failure(Type Function)

Optional function performed after validation failed (default: null)  

    - failureParams(Type Object[])

An array defining the parameters passed to the function defined in the failure (default: [form, action] - standard result of the failure function for sending the form)

    • Function result: none

 

  • insertHtml- inserts a piece of HTML code anywhere on the form.
    • Function parameters:

Name

Type

Default value

Description

html

String

null

Part of HTML code. In order to make the inserted part of HTML code similar to the system, the following CSS classes can be used: suncode-container-underline (adds underlining), suncode-form-label (style for field label), suncode-form-gray-panel(gives the background color compatible with form, the CSS class can be added only to the divcomponents). In addition, if you want to put the inserted code on the left side of the form, use one of the following styles: text-align: left, float: left. Similarly, the HTML code is placed on the right with the same properties, but with the right value. In addition, we can align components using the margin-left styles: Xpx and margin-right: Xpx. The HTML code can be centered using the combination of margin-left: auto andmargin-right: 0.

variableId

String

null

Identifier of the form variable (process variable) against which the HTML code part is inserted. It can also be a dynamic table identifier. If the parameter is empty or there is no variable on the form with the given identifier, the HTML code part is inserted at the beginning/end of the form (depending on the parameter before)

before

Boolean

false

Indicates whether the HTML code part should be inserted before the specified form variable/dynamic table. If the variableIdparameter is empty or there is no variable on the form with the given identifier, the code fragment is inserted at the beginning/end of the form, depending on the parameter value adopted.

sameLine

Boolean

false

Indicates whether the HTML code part should be inserted in the same row as the specified form variable/dynamic table. If thevariableId parameter is empty or the variable with the given identifier does not exist on the form, then the value of the parameter does not matter.

    • Function result: none

 

  • hideSaveFormButton- hides the save form button.
    • Function parameters: none
    • Function result: none

 

  • showSaveFormButton- shows the button for saving the form.
    • Function parameters: none
    • Function result: none

 

  • hideShowCommentButton (from 3.1.15) hides the button for adding a comment.
    • Function parameters: none
    • Function result: none

 

  • showShowCommentButton (from 3.1.15) shows the button for adding a comment.
    • Function parameters: none
    • Function result: none

 

  • hideButton(3.1.13) hides buttons with the given action names.
    • Function parameters:

 


Name

Type

Default Value

Description

actionName

String

null

The name of the action (actionName) of the button.

It is possible to hide many buttons at the same time - just add multiple parameters:

formService.hideButton('buttona', 'buttonb');

 

    • Function result: none

 

  • showButton - (3.1.13) shows buttons with the given action names:
    • Function parameters:

 

Name

Type

Default Value

Description

actionName

String

null

The name of the action (actionName) of the button.

It is possible to show many buttons at the same time - just add multiple parameters:

formService.showButton('buttona', 'buttonb');

 

    • Function result: none

 

  • hideLabel - (3.1.24) hides the form labelswith given identifiers

 

Info
titleinfo

The PWE plugin from version 2.1-SNAPSHOT dated 11/12/2015 does not change the form label identifiers. Earlier versions generate new identifiers when exporting to the new version of the package. 

 

    • Function parameters:

Name

Type

Default value

Description

actionName

String

null

Label identifier.

It is possible to hide multiple labels at once - just add multiple parameters:

formService.hideLabel('labela', 'labelb');

 

    • Function result: none

 

  • showLabel - (3.1.24) shows the form labelswith given identifiers.

 

Info

ThePWEplugin from version 2.1-SNAPSHOTdated 11/12/2015 does not changethe form label identifiers. Earlier versions generate new identifiers when exporting to the new version of the package. 

 

    • Function parameters

Name

Type

Default value

Description

actionName

String

null

Label identifier.

It is possible to show multiple labels at once - just add multiple parameters:

formService.showLabel('labela', 'labelb');

 

    • Function result: none

 

  • blockAcceptance – blocks the possibility to accept the task

After calling the function, the possibility of accepting the form is blocked. The acceptance buttons are grayed out (disabled: false), and when accepted by JavaScript, a message is displayed that the task can not be accepted. The mechanism does not block direct acceptance. The mechanism is implemented in JavaScript - it does not affect server acceptance.

The number of acceptance blocks is counted, which means that there must be as many calls to the function to unlock the form as blocking.

    • Function parameters: none
    • Function result: none

 

  • unblockAcceptance - unlocks the possibility of accepting the task
    • Function parameters: none
    • Function result: none

 

  • isAcceptanceBlocked - checks whether the acceptance of the form is blocked
    • Function parameters: none
    • Function result: true/false if the acceptance of the form is blocked/unblocked

 

 

...