Skip to main content
Version: 2023

Messages

Error messages, warnings or informational error messages are also modelled in the Software Factory, with the possibility to define a translation, severity and location. This applies to both messages that are sent from functionality (code templates) and messages that are caused by the database, such as constraints and checks.

1538638669734 Example of a message as it may appear in an end product.

Modeling messages

To model a message:

menu User interface > Messages > tab Form

  1. Add a Message id to reference the message from the business logic. This ID is translated in the Translations tab page.

  2. Add a brief description of the purpose of the message is given in the Descriptions tab.

  3. The Message location indicates how the message should be displayed:

    • Pop-up.
    • Panel - It is possible to clear the panel with the message clear_panel or add a separator line to the panel by sending the add_separator message.
      • Windows GUI and Web GUI: message is displayed at the bottom of the screen.
      • Universal GUI: message is displayed in a snack bar at the bottom of the screen.
    • None (suppress) - suppresses database messages.
    • Debug:
      • Windows GUI and Web GUI: message is displayed in the debug window.
  4. Select the Severity of the message: 'error', 'warning', or 'information'. This determines how the user interfaces and the Indicium application tier handle the action that caused the message. The action is only canceled for errors.

  5. Universal Windows GUI If you want to add a sound to your message, upload an Audio file. The file will be played upon receiving the message. The allowed extensions are .wav and .mp3. You can add sound to popups as well as to panel messages.

message form Form to create a message

Message options

menu User interface > Messages > tab Message options

It is possible to add options to a message. These options represent the choices a user can make when presented with the message when used in a process flow. For example, this configuration in the Software Factory:

https://office.thinkwisesoftware.com/blog/wp-content/uploads/2017/12/show_message5.png

will result in this dialog in the GUI:

https://office.thinkwisesoftware.com/blog/wp-content/uploads/2017/12/show_message1.png

An affirmative message option will be given a unique status code of zero or higher, while a negative message option will be given a unique negative status code. These response types and corresponding status codes are directly related to the green and red arrows in the process flow. In some cases, it might be necessary to have multiple affirmative and/or multiple negative message options which have different effects on the continuation of the process flow. To achieve this, the Status code value of a message option will be passed as the Status code output parameter of the process action.

Icons are optional and the sequence number of the message option (#) determines the order of the buttons on the dialog.

Translations

menu User interface > Messages > tab Translations

In the Translations tab, a translation can be specified in which parameters are defined with {0}, {1} etcetera.

Modifying database messages using regular expressions

menu User interface > Messages > tab Form

To translate or suppress a database message using a regular expression:

  1. Deselect the Hide generated hide generated prefilter.

    Now, you can also see the existing generated messages containing a regular expression. These messages can be a good starting point for translation.

  2. Select a database message that includes a regular expression.

  3. Copy  copy this message into a new message.

  4. Adjust the message.

  5. Adjust the Message location if desired. To suppress the message, select None (suppress).

  6. Optionally, you can specify a translation in which parameters are defined.

Sending messages

Task confirmation message

You can choose a confirmation message to show up when executing a task. To make this message dynamic, you can add one or more parameters to it. To do this, you need to follow a few steps:

  1. Add the parameter you want to use to the task.
  2. Create a default procedure for the task, to fill the parameter you just configured.
  3. Create a message for your task confirmation. In the message translation, add the parameter you created for your task.

message_parameter Message with a parameter

The result in your end product:

message_parameter_gui Message with a parameter in the end product

Message from an SQL template

To send a message from an SQL template, you can use the tsf_send_message procedure:

tsf_send_message [message id], [parameter string], [abort]

Parameter string

This is an optional XML string, in which you can configure what parameters can be used in the translation. It is also possible to use translations of model objects, such as columns or tables.

An example parameter string, which specifies the text Welcome for parameter {0}, and the plural translation of column name of the customer table for parameter {1} is shown below.

<text>Welcome</text><col tabid="customer" colid="name" transl="plural"/>

The following XML elements with associated attributes can be used:

<text>Text to display</text>

<tab tabid="tab_id" transl="standard, form, grid, plural"></tab>

<col tabid="tab_id" colid="col_id" transl=""></col>

<domelement domid="dom_id" elementid="element_id" transl=""></domelement>

<task taskid="task_id" transl=""></task>

<taskparam taskid="task_id" taskparamid="task_parmtr_id" transl=""></taskparam>

<report reportid="report_id" transl=""></report>

<reportparam reportid="report_id" reportparamid="report_parmtr_id" transl=""></reportparam>

For example, for message duplicate_customer with translation 'Note, {0} already exists as a {1}' you can use the following:

exec tsf_send_message 'duplicate_customer', 
'<text>Thinkwise</text><tab tabid="customer" transl="standard"/>', 1;

This results in 'Note, Thinkwise already exists as a Customer'.

Special characters in the parameter string parameter

caution

In the parameter string parameter, special characters must be escaped.

For example, to specify the & character, write: <text>This text contains an &amp; character</text>.

The special characters are:

To specify:Write:
&&amp;
"&quot;
'&apos;
<&lt;
>&gt;

Abort

This indicates the database severity level.

For SQL Server, specifying 0 results in a database message with severity 9. Specifying 1 or NULL results in a database message with severity 16. Because SQL Server does not rollback automatically, a rollback and return have to be explicitly executed to abort a transaction. For example:

exec tsf_send_message 'duplicate_customer', null, 1;
rollback;
return;

For Oracle, specifying true results in a raise_application_error which will abort the transaction and false results in a dbms_output.put_line.

For DB2, the abort parameter is ignored as a transaction and is always aborted when a message is sent. In order to still provide informational messages on DB2 in defaults and layouts, these logic concepts have an extra parameter v_message_text that can be set to show in an informational message.

Was this page helpful?

Happy React is loading...