To output information both to the model developer and user, the causeType must be stated accordingly:
CauseType.LIBRARY: Appears in the console and in the Message log view.
CauseType.PROJECT: Appears in the console and in the Message log view. Similarly, a message window is displayed that contains the message text as Form-UI.
Groovy:
import org.foederal.util.ui.messages.UserMessageCollector;
logText = "Delete Operation";
logText1 = "Delete failed. No item was selected.";
logText2 = "Delete succeeded.";
logText3 = "Delete failed: ";
logText4 = "Delete failed. Please contact your library administrator.";
[...]
if (selectedObject == null)
{
UserMessageCollector.addError(PROJECT, self, null, logText, logText1);
return;
}
try
{
[... Delete operation ...]
UserMessageCollector.addInfo(PROJECT, self, null, logText , logText2);
}
catch (Exception e)
{
UserMessageCollector.addError(LIBRARY, self, null, logText, logText3 + e.getMessage(), e);
UserMessageCollector.addError(PROJECT, self, null, logText, logText4, null);
}