TaskRunner Objects
The TaskRunner provides a convenient way of creating
and running tasks synchronously.
t.createStream(name, autoConnect, autoManage) : Stream
name (string) : the object's name
autoConnect (boolean) : whether the stream should be auto-connected to the
server
autoManage (boolean) : whether the stream should be added to the stream
manager
Creates and returns a new Stream. Note that code that needs to create streams
privately without having them made visible to the user should set the autoManage
flag to False.
Exceptions:
ServerConnectionException : if the Session is already connected and the
auto-connect flag is True but a new connection could not be created for the
stream
t.exportDocumentToFile(documentOutput, filename, fileFormat)
documentOutput (DocumentOutput) : the document to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format
Exports the stream description to a file using the specified file format.
Exceptions:
OwnerException : if the document is not owned by the task runner session
SessionException : if the document cannot be exported for some reason
ExportFormatException : if the document does not support the export format
t.exportModelSummaryToFile(modelOutput, filename, fileFormat)
modelOutput (ModelOutput) : the model to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format which is either
FileFormat.PLAIN_TEXT or FileFormat.HTML.
Exports the model summary to a file using the specified file format. Model summaries can only be exported as text or HTML.
Exceptions:
OwnerException : if the model is not owned by the task runner session
SessionException : if the model cannot be exported for some reason
ExportFormatException : if the model does not support the export format
t.exportModelSummaryToFile(node, filename, fileFormat)
modelOutput (Node) : the model applier node to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format which is either
FileFormat.PLAIN_TEXT or FileFormat.HTML.
Exports the model summary in the supplied node to a file using the specified file format. Model summaries can only be exported as text or HTML.
Exceptions:
OwnerException : if the model is not owned by the task runner session
SessionException : if the model cannot be exported for some reason
ExportFormatException : if the model does not support the export format
t.exportModelToFile(modelOutput, filename, fileFormat)
modelOutput (ModelOutput) : the model to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format
Exports the model to a file using the specified file format.
Exceptions:
OwnerException : if the model is not owned by the task runner session
SessionException : if the model cannot be exported for some reason
ExportFormatException : if the model does not support the export format
t.exportModelToFile(node, filename, fileFormat)
modelOutput (Node) : the model applier node to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format
Exports the model in the supplied node to a file using the specified file format.
Exceptions:
OwnerException : if the model is not owned by the task runner session
SessionException : if the model cannot be exported for some reason
ExportFormatException : if the model does not support the export format
t.exportOutputToFile(object, filename, fileFormat, options)
object (PropertiedObject) : the object with the output content
filename (string) : the file name where the output should be exported to
fileFormat (FileFormat) : the file format
options (Map) : either None or a hash table of attribute values
Exports the output content from the supplied object to the specified file and format. The following document formats are supported:
-
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
The following image formats are supported:
-
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 handled
For 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 represent
Exceptions:
OwnerException : if the object is not owned by the current session
ExportFormatException : if the export format is not supported
SessionException : if some other error occurs
t.exportStreamToFile(stream, filename, fileFormat)
stream (Stream) : the stream to be exported
filename (string) : the exported file path
fileFormat (FileFormat) : the export file format
Exports the stream description to a file using the specified file format.
Exceptions:
OwnerException : if the stream is not owned by the task runner session
SessionException : if the stream cannot be exported for some reason
ExportFormatException : if the stream does not support the export format
t.insertNodeFromFile(filename, diagram) : Node
filename (string) : the file path
diagram (Diagram) : the diagram that the node should be inserted into
Reads and returns a node from the specified file, inserting it into the supplied diagram. Note
that this can be used to read both Node and SuperNode objects.
Exceptions:
OwnerException : if the diagram is not owned by the task runner session
SessionException : if the node cannot be loaded for some reason
ObjectLockedException : if the stream that the node is being added to is
locked
t.openDocumentFromFile(filename, autoManage) : DocumentOutput
filename (string) : the document file path
autoManage (boolean) : whether the document should be added to the output
manager
Reads and returns a document from the specified file.
Exceptions:
SessionException : if the document cannot be loaded for some reason
t.openModelFromFile(filename, autoManage) : ModelOutput
filename (string) : the model file path
autoManage (boolean) : whether the model should be added to the model
manager
Reads and returns a model from the specified file.
Exceptions:
SessionException : if the model cannot be loaded for some reason
t.openStreamFromFile(filename, autoManage) : Stream
filename (string) : the stream file path
autoManage (boolean) : whether the stream should be added to the stream
manager
Reads and returns a stream from the specified file.
Exceptions:
SessionException : if the stream cannot be loaded for some reason
t.saveDocumentToFile(documentOutput, filename)
documentOutput (DocumentOutput) : the document to be saved
filename (string) : the document file path
Saves the document to the specified file location.
Exceptions:
OwnerException : if the document is not owned by the task runner session
SessionException : if the document cannot be saved for some reason
t.saveModelToFile(modelOutput, filename)
modelOutput (ModelOutput) : the model to be saved
filename (string) : the model file path
Saves the model to the specified file location.
Exceptions:
OwnerException : if the model is not owned by the task runner session
SessionException : if the model cannot be saved for some reason
t.saveNodeToFile(node, filename)
node (Node) : the node to be saved
filename (string) : the node file path
Saves the model to the specified file location.
Exceptions:
OwnerException : if the node is not owned by the task runner session
SessionException : if the node cannot be saved for some reason
t.saveStreamToFile(stream, filename)
stream (Stream) : the stream to be saved
filename (string) : the stream file path
Saves the stream to the specified file location.
Exceptions:
OwnerException : if the stream is not owned by the task runner session
SessionException : if the stream cannot be saved for some reason