The MessageLanguage Method
You can generate all kinds of messages, by calling the MessageLanguage method of the internal RulesEngine component.
This method has almost the same behavior as the MessageLanguage() application method. The main addition is that methods of a component can be called from an INVOKE statement.
If the message has been translated in the System Local Messages window, and you use the language, you get the translated message.
To generate a system message, execute the following statement:
SELECT RulesEngine.MessageLanguage('<category>', '<name>', '<type>' [,'<par1>', '<par2>', ...])
The MessageLanguage method requires the following parameters:
Mandatory parameter. This is the category that the message belongs to, specified in the System Messages window.
Mandatory parameter. This is the logical name of the message that has been specified in the System Messages window.
Mandatory parameter. The value can be:
The QUESTION type can only be used within a Client-Server application. When used in a web application, Batch Runner, or the Remote Rules Service API, you get an error message.
Optional parameter(s). This is a string that substitutes a parameter in the message. The method call can have any number of parameters, thus has a variable number of input parameters.
SELECT 'Frequent End User Msg', 'COMMIT', 'INFORMATION', '4'
This results in an information message: '4 record(s) committed'.
Suppose that when a contract is signed, the user must decide whether the contract must be frozen or not. You can write a transitional constraint to achieve this:
SET frozen= 'Y'
WHERE OLD(signed) = 'N'
AND signed = 'Y'
If the message type is set to ERROR, and the message is called from the SQL Command dialog, you always get an additional, general error message. This is expected behavior.
Failed to execute the command.
Failed to open select cursor for statement