public interface TaskRunner
TaskRunner
provides a convenient way of creating and running
tasks synchronously.Modifier and Type | Method and Description |
---|---|
ProcessorStream |
createStream(java.lang.String name,
boolean autoConnect,
boolean autoManage)
Creates and returns a new
ProcessorStream . |
void |
exportDocumentToFile(DocumentOutput documentOutput,
java.lang.String filename,
FileFormat fileFormat)
Exports the stream description to a file using the specified file format.
|
void |
exportModelSummaryToFile(ModelOutput modelOutput,
java.lang.String filename,
FileFormat fileFormat)
Exports the model summary to a file using the specified file format.
|
void |
exportModelSummaryToFile(Processor node,
java.lang.String filename,
FileFormat fileFormat)
Exports the model summary in the supplied node to a file using the specified file format.
|
void |
exportModelToFile(ModelOutput modelOutput,
java.lang.String filename,
FileFormat fileFormat)
Exports the model to a file using the specified file format.
|
void |
exportModelToFile(Processor node,
java.lang.String filename,
FileFormat fileFormat)
Exports the model in the supplied node to a file using the specified file format.
|
void |
exportOutputToFile(PropertiedObject object,
java.lang.String filename,
FileFormat fileFormat,
java.util.Map<?,?> options)
Exports the output content from the supplied object to the specified file and format.
|
void |
exportStreamToFile(ProcessorStream stream,
java.lang.String filename,
FileFormat fileFormat)
Exports the stream description to a file using the specified file format.
|
ModelOutput |
importPMMLModelFromFile(java.lang.String filename,
boolean autoManage)
Reads PMML from the specified file and returns a model.
|
Processor |
insertNodeFromFile(java.lang.String filename,
ProcessorDiagram diagram)
Reads and returns a node from the specified file, inserting it into
the supplied diagram.
|
DocumentOutput |
openDocumentFromFile(java.lang.String filename,
boolean autoManage)
Reads and returns a document from the specified file.
|
ModelOutput |
openModelFromFile(java.lang.String filename,
boolean autoManage)
Reads and returns a model from the specified file.
|
ProcessorStream |
openStreamFromFile(java.lang.String filename,
boolean autoManage)
Reads and returns a stream from the specified file.
|
java.lang.String |
publishModelToScoringAdapterTask(Processor node,
ServerDatabaseConnection dbConnection,
java.lang.String publishId)
Publishes the model from a model apply
Processor to the specified database
and optional ID. |
void |
saveDocumentToFile(DocumentOutput documentOutput,
java.lang.String filename)
Saves the document to the specified file location.
|
void |
saveModelToFile(ModelOutput modelOutput,
java.lang.String filename)
Saves the model to the specified file location.
|
void |
saveNodeToFile(Processor node,
java.lang.String filename)
Saves the node to the specified file location.
|
void |
saveStreamToFile(ProcessorStream stream,
java.lang.String filename)
Saves the stream to the specified file location.
|
ProcessorStream createStream(java.lang.String name, boolean autoConnect, boolean autoManage) throws ServerConnectionException
ProcessorStream
. Note that code that needs to create streams
privately without having them made visible to the user should set the autoManage flag to false
.name
- the object's nameautoConnect
- whether the stream should be auto-connected to the serverautoManage
- whether the stream should be added to the stream managerProcessorStream
ServerConnectionException
- if the Session is already connected
and the auto-connect flag is true
but a new connection could not be created
for the streamProcessorStream openStreamFromFile(java.lang.String filename, boolean autoManage) throws SessionException
filename
- the stream file pathautoManage
- whether the stream should be added to the stream managerSessionException
- if the stream cannot be loaded for some reasonvoid saveStreamToFile(ProcessorStream stream, java.lang.String filename) throws OwnerException, SessionException
stream
- the stream to be savedfilename
- the stream file pathOwnerException
- if the stream is not owned by the task runner sessionSessionException
- if the stream cannot be saved for some reasonvoid exportStreamToFile(ProcessorStream stream, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
stream
- the stream to be exportedfilename
- the exported file pathfileFormat
- the export file formatOwnerException
- if the stream is not owned by the task runner sessionSessionException
- if the stream cannot be exported for some reasonExportFormatException
- if the stream does not support the export formatModelOutput openModelFromFile(java.lang.String filename, boolean autoManage) throws SessionException
filename
- the model file pathautoManage
- whether the model should be added to the model managerSessionException
- if the model cannot be loaded for some reasonvoid saveModelToFile(ModelOutput modelOutput, java.lang.String filename) throws OwnerException, SessionException
modelOutput
- the model to be savedfilename
- the model file pathOwnerException
- if the model is not owned by the task runner sessionSessionException
- if the model cannot be saved for some reasonvoid saveNodeToFile(Processor node, java.lang.String filename) throws OwnerException, SessionException
node
- the node to be savedfilename
- the node file pathOwnerException
- if the node is not owned by the task runner sessionSessionException
- if the node cannot be saved for some reasonvoid exportModelToFile(ModelOutput modelOutput, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
modelOutput
- the model to be exportedfilename
- the exported file pathfileFormat
- the export file formatOwnerException
- if the model is not owned by the task runner sessionSessionException
- if the model cannot be exported for some reasonExportFormatException
- if the model does not support the export formatvoid exportModelToFile(Processor node, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
node
- the model applier node to be exportedfilename
- the exported file pathfileFormat
- the export file formatOwnerException
- if the model is not owned by the task runner sessionSessionException
- if the model cannot be exported for some reasonExportFormatException
- if the model does not support the export formatvoid exportModelSummaryToFile(ModelOutput modelOutput, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
modelOutput
- the model to be exportedfilename
- the exported file pathfileFormat
- the the export file format which is either FileFormat.PLAIN_TEXT
or FileFormat.HTML
OwnerException
- if the model is not owned by the task runner sessionSessionException
- if the model cannot be exported for some reasonExportFormatException
- if the model does not support the export formatvoid exportModelSummaryToFile(Processor node, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
node
- the model applier node to be exportedfilename
- the exported file pathfileFormat
- the export file format which is either FileFormat.PLAIN_TEXT
or FileFormat.HTML
OwnerException
- if the model is not owned by the task runner sessionSessionException
- if the model cannot be exported for some reasonExportFormatException
- if the model does not support the export formatDocumentOutput openDocumentFromFile(java.lang.String filename, boolean autoManage) throws SessionException
filename
- the document file pathautoManage
- whether the document should be added to the output managerSessionException
- if the document cannot be loaded for some reasonvoid saveDocumentToFile(DocumentOutput documentOutput, java.lang.String filename) throws OwnerException, SessionException
documentOutput
- the document to be savedfilename
- the document file pathOwnerException
- if the document is not owned by the task runner sessionSessionException
- if the document cannot be saved for some reasonvoid exportDocumentToFile(DocumentOutput documentOutput, java.lang.String filename, FileFormat fileFormat) throws OwnerException, SessionException, ExportFormatException
documentOutput
- the document to be exportedfilename
- the exported file pathfileFormat
- the export file formatOwnerException
- if the document is not owned by the task runner sessionSessionException
- if the document cannot be exported for some reasonExportFormatException
- if the document does not support the export formatProcessor insertNodeFromFile(java.lang.String filename, ProcessorDiagram diagram) throws OwnerException, SessionException, ObjectLockedException
Processor
and CompositeProcessor
objects.filename
- the file pathdiagram
- the diagram that the node should be inserted intoProcessor
OwnerException
- if the diagram is not owned by the task runner sessionSessionException
- if the node cannot be loaded for some reasonObjectLockedException
- if the stream that the node is being added to is lockedModelOutput importPMMLModelFromFile(java.lang.String filename, boolean autoManage) throws SessionException
filename
- the PMML file pathautoManage
- whether the model should be added to the model managerSessionException
- if the model cannot be imported for some reasonjava.lang.String publishModelToScoringAdapterTask(Processor node, ServerDatabaseConnection dbConnection, java.lang.String publishId) throws PredictiveServerException
Processor
to the specified database
and optional ID. Returns a string representing an example of the SQL needed to call the model.
The node needs to be connected to another node that provides all the columns necessary
for applying the model. The stream that owns the node should be connected to a server
that can access the database and the database connection must have been
created via the stream that owns the supplied node.node
- the Processor
containing the modeldbConnection
- the database connection associated with the node's streampublishId
- (DB2 for z/OS databases only) an identifier for the modelPredictiveServerException
- if the model cannot be published for some reasonProcessorStream.createServerDatabaseConnection(String, String, String, String)
void exportOutputToFile(PropertiedObject object, java.lang.String filename, FileFormat fileFormat, java.util.Map<?,?> options) throws OwnerException, SessionException, ExportFormatException
FileFormat.PLAIN_TEXT
FileFormat.HTML
FileFormat.RTF
FileFormat.SPV
FileFormat.SPW
FileFormat.SPSS_WEB_REPORT
FileFormat.COGNOS_ACTIVE_REPORT
FileFormat.PDF
FileFormat.MS_EXCEL
FileFormat.MS_EXCEL2007
FileFormat.MS_EXCEL2007_M
FileFormat.MS_POWERPOINT
FileFormat.BITMAP
FileFormat.PNG
FileFormat.JPEG
FileFormat.TIFF
If options
are supplied, the value is a table of attribute/value pairs.
For document exports, the options are:
alternate_log_file_location
(string): the location of the log file if this is to be expored separatelycustom_report_title
(string): a custom title for a web reportexcel_location_option
("AddColumns", "AddRows", "OverwriteAtCellRef"): where the content should be exported to in Excelexcel_operation_option
("CreateWorkbook", "CreateWorksheet", "ModifyWorksheet"): how the content should be exported to Excelexcel_sheetname
(string): the Excel sheet nameexcel_starting_cell_ref
(string): the Excel starting cell referencesexport_html_headers
(Boolean): whether to export HTML headersexport_image_maps
(Boolean): whether to create image mapsexport_images
(Boolean): whether images should be exported separately for formats that don't support imageshtml_with_style
(Boolean): whether style information should be savedinclude_footnotes_and_captions
(Boolean): whether footnotes and captions should be includedinteractive_layer
(Boolean): whether an interactive layer should be included in formats that support themis_logs_excluded
(Boolean): whether exclude logsis_notes_excluded
(Boolean): whether to exclude notesis_text_excluded
(Boolean): whether to exclude text contentjavascript_file_name
(string): for interactive output, the location of the JavaScript file if separatemodel_view_option
("MVExportAll", "MVExportVisible", "MVPrintSetting"): which model views should be exportedpage_break_between_table
(Boolean): whether to create a page break between tablespage_setup
(Map): the page setup settings (see below)pdf_embed_bookmarks
(Boolean): whether to embed bookmarks in PDF documentpdf_embed_fonts
(Boolean): whether to embed fonts in the PDF documentpivot_table_option
("PTExportAllLayers", "PTExportVisibleLayers", "PTUsePrintLayerSetting"): how pivot tables should be handledppt_use_viewer_outlines
(Boolean): whether to use viewer outlines in the PowerPointpreserve_break_points
(Boolean): whether to preserve break pointstable_style
(string): the name of the table styletext_encoding
("utf8", "utf16"): what text encoding to use in text filestext_doc_option
("TxtUseSpaces", "TxtUseTabs"): whether to uses spaces or tabs in text filestext_width_autofit
(Boolean): whether to make table columns fit the content in text filestxt_column_width
(integer): if table columns are not fitted to their content in text files, defines the column widthcol_txt_border_character
(character): the table column character when exporting to a text filerow_txt_border_character
(character): the table column character when exporting to a text fileviewer_doc_name
(string): the name of the document which should be displayed in the viewerwide_tables_option
("WT_Extend", "WT_Shrink", "WT_Wrap"): defines how wide tables should be handledFor graph exports, the options are:
bmp_compress_image
(Boolean): whether to compress bitmap imagesgraph_image_size
(integer): how much to scale the exported image as a percentage of the originalgraph_invert_colors
(Boolean): whether to invert the colorsgraph_type
("BMP", "JPG", "PNG", "TIF"): defines the graph type to be used when exporting images separately from the non-image contentmodel_view_option
("MVExportAll", "MVExportVisible", "MVPrintSetting"): which model views should be exportedpng_color_depth
("BlackWhite", "Grays", "SixteenColors", "TrueColor24", "TrueColor36", "TwoFiftySixColors"): the color depth when exporting to PNGtiff_color_space
("CMYK", "RGB"): the color space when exporting to TIFtiff_compress_image
(Boolean): whether to compress TIF images
For the page_setup
, the options are:
height
(Double): the page heightwidth
(Double): the page widthbottom_margin
(Double): the bottom marginleft_margin
(Double): the left marginright_margin
(Double): the right margintop_margin
(Double): the top marginorientation
(Integer): 0 for portrait, 1 for landscapeunits
("Centimeters", "Millimeters", "Inches", "PrintPoints"): the units that the margin and dimension values representobject
- the object with the output contentfilename
- the file name where the output should be exported tofileFormat
- the file formatoptions
- either null
or a hash table of attribute valuesOwnerException
- if the object is not owned by the current sessionExportFormatException
- if the export format is not supportedSessionException
- if some other error occurs(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.