User Dialog Concept
The concept of a User Dialog follows the famous Model-View-Controller pattern. It consist of the following parts:
Data - The internal data of the User Dialog (the model)
View / Panel - The visual representation of the User Dialog (the view)
Logic - The implementation of the functionality (the behavior) of the User Dialog (the controller)
Interface - A description of the capabilities of the User Dialog
The logic (i.e. controller) of User Dialogs is implemented in a process based manner. This means that all the GUI events (which are generated by the user who interacts with the dialog) are handled by means of a corresponding UI process in the logic of the User Dialog component. So the behaviour of the User Dialog is not implemented by writing source code in a programming language (such as Java, Visual Basic or C#) but rather by graphically modeling a process logic in Axon.ivy.
The multi-part structure of a User Dialog becomes also evident when looking at its representation in the Axon.ivy project tree:
Interface
The interface of a User Dialog defines its behavior in an abstract way and independent of its implementation. In other words it defines what a User Dialog is capable to do. In more detail, the interface defines Start Methods and Methods of a User Dialog. The interface can be viewed with the User Dialog Interface Editor.
Logic
The logic of a User Dialog defines how a User Dialog performs its work by means of a process model. For each UI Event (triggered by the actual user, e.g. by clicking on a button) and for each Start Method and Method defined on the interface you may implement a process to handle these events.
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 is somewhat different from the standard set. The extra User Dialog drawer of the Process Editor palette contains elements, which can only be used within User Dialog logic:
Icon |
Title |
Short Description |
---|---|---|
User Dialog |
Opens another User Dialog |
|
Init Start |
Invoked when the User Dialog is started. This element is executed at most once and initializes the User Dialog and its data. |
|
Method start |
Invoked when one of the methods declared in the User Dialog Interface is called. |
|
Event Start |
Invoked when a mapped widget event is received from the view of the User Dialog. |
|
Process End |
Ends a User Dialog UI process. |
|
Exit End |
Exits and closes this User Dialog and continues with the calling process (if opened synchronously). |
On the other hand, some elements of the Dialog & Control drawer are missing, because they are forbidden:
Icon |
Title |
Short Explanation |
---|---|---|
Request Start |
The normal Request element is replaced with the User Dialog start element. |
|
Web Page |
The Page element is HTML-specific and thus not available in the User Dialog logic. |
|
Tasks |
The Tasks element is not available because role change and task data persistence can only happen between User Dialogs. |
|
Task |
The Task element is not available because role change and task data persistence can only happen between User Dialogs. |
|
Event Start |
Start Event Beans are currently not supported inside User Dialogs. |
|
Intermediate |
Intermediate Events are currently not supported inside User Dialogs. |
|
Call & Wait |
Call & Wait are currently not supported inside User Dialogs. |
|
Process End |
The regular Process End element is replaced with the User Dialog End element. |
|
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 executes 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 execution of the callable process.
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 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.