User Dialog Concept

The concept of a User Dialog follows the famous Model-View-Controller pattern. It consists of the following parts:

  • Data - The internal data of the User Dialog (the model)

  • View - The visual representation of the User Dialog (the view)

  • Logic - The implementation of the functionality (the behavior) of the User Dialog (the controller)

The logic of a User Dialog is implemented in a process-based manner. All the GUI events (which are generated by the user who interacts with the dialog) are handled by a corresponding UI process in the logic of the User Dialog component.

The multi-part structure of a User Dialog becomes also evident when looking at its representation in the Axon Ivy project tree:

Project
└── Html Dialogs
    └── ch.ivyteam.ivy.dialog
        └── Demo
            └── Demo Form / View
            └── Demo Logic
            └── Demo Data

Logic

The logic of a User Dialog defines how a User Dialog performs its work. For each UI Event triggered by the user (e.g., by clicking on a button). All the starts events are defined here, to build the interface for this dialog.

The logic of a User Dialog is edited and defined using the Process Editor.

To build the logic of a User Dialog, the Process Editor offers a set of process elements that are somewhat different from the standard set:

Process elements only available in User Dialog Logic

Icon

Title

Short Description

dialog-call

User Dialog

Opens another User Dialog

hd-init-start

Init Start

Invoked when the User Dialog is started. This element is executed at most once and initializes the User Dialog and its data.

hd-method-start

Method start

Invoked when one of the methods declared in the User Dialog Interface is called.

hd-event-start

Event Start

Invoked when a mapped widget event is received from the view of the User Dialog.

hd-end

Process End

Ends a User Dialog UI process.

hd-exit-end

Exit End

Exits and closes this User Dialog and continues with the calling process (if opened synchronously).

On the other hand, some elements are missing, because they are forbidden:

Process elements that are forbidden in User Dialog Logic

Icon

Title

Short Explanation

request-start

Request Start

The normal Request element is replaced with the User Dialog start element.

task-switch-gateway

Tasks

The Tasks element is not available because role change and task data persistence can only happen between User Dialogs.

task-intermediate

Task

The Task element is not available because role change and task data persistence can only happen between User Dialogs.

program-start

Program Start

Start Event Beans are currently not supported inside User Dialogs.

wait-intermediate

Wait

Intermediate Events are currently not supported inside User Dialogs.

task-end

Process End

The regular Process End element is replaced with the User Dialog End element.

end-page

End Page

The End Page element is HTML-specific and thus not available in the User Dialog logic.

Warning

When invoking callables from inside a User Dialog you have to bear in mind, that the callable process will be executed within the scope of the User Dialog that calls it, i.e., the same restrictions apply as if the callable was defined right inside the User Dialog’s logic. This ultimately means that you have to ensure that the called (business) process does not contain any of the forbidden elements mentioned above. Otherwise, you will experience failures or unpredictable results during the execution of the callable process.

View

The view of a User Dialog defines the User Interface which is presented to the end user. A view can be written via the Form Editor or in plain code (JSF) via the HTML Dialog Editor.

Data

The data of a User Dialog define its internal state (if you are familiar with the MVC pattern, you should consider the data as the Model of a User Dialog). The data of a User Dialog has private scope (i.e., is not visible from the outside). Access can be granted by defining and implementing methods that return or manipulate internal data. The data of a User Dialog is edited with the Data Class Editor.