Error reporting for flows

You can create a script that uses the report API method to generate notifications for error, warning, and information messages for SPSS Modeler flows. These notifications appear in Messages and the Run history. Without the report API method, Messages shows only errors and warnings.

In the script, you can define which of these messages you want reported for the SPSS Modeler flow. You can also set the specific message that you want to appear in Messages and the Run history.

Example script

In the following example, the script creates three Diagnostic objects. Each Diagnostic object maps to one of the three types of messages. These diagnostic objects have severity levels and associated messages.

import modeler.api
from com.spss.psapi.extensions.common import Diagnostic
stream = modeler.script.stream()
diag = Diagnostic.error("Flow error reported from script")
stream.report(diag)
diag = Diagnostic.warning("Flow warning reported from script")
stream.report(diag)
diag = Diagnostic.information("Flow information reported from script")
stream.report(diag)