流程错误报告
您可以创建一个脚本,使用 API report 方法为 SPSS Modeler 流程生成错误、警告和信息消息的通知。 这些通知会显示在消息和运行历史记录中。 若未启用 report API 方法 ,消息仅显示错误和警告。
在脚本中,您可以定义希望为该 SPSS Modeler 流程报告哪些消息。 您还可以设置希望在消息和运行历史记录中显示的具体内容。
示例脚本
在下面的示例中,脚本创建了三个诊断对象。 每个诊断对象都映射到三种消息类型之一。 这些诊断对象具有严重性级别和相关消息。
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)