Initializing help system before first use

Scenario Attachments

Scenario attachments can both be read and written by the model.

They have two main uses: as an optional source of input data, and as a way of creating alternative result artifacts, such as a PDF or a spreadsheet.

When a scenario is created it has no attachments, so the model should check whether the attachment existed after trying to download it from the server. One option is to check for an app attachment of the same name if the scenario attachment does not exist:
self.insight.get_app_attach('input.dat')
if self.insight.attach_status != xi.AttachStatus.OK:
    self.insight.get_app_attach('input.dat')
    if self.insight.attach_status != xi.AttachStatus.OK:        
        raise Exception('Failed to get attachment "input.dat"')

# process file 'input.dat'
This allows an app to supply a default input data file as an app attachment, which can then be optionally overridden for each scenario by downloading it, modifying it, then uploading it as a scenario attachment. A model can also create scenario attachments as a result of its execution. The file to attach must exist must first be created in the current working directory before being transferred to the server. For example, use mmsheet to create a spreadsheet containing result data, then:
# create a spreadsheet containing result data, then: 
self.insight.put_scen_attach('results.xls')
Several other subroutines are available which affect scenario attachments.
  • Calling AppInterface.set_scen_attach_desc provides a description for an attachment, which will appear in the attachments dialog in the web client and can be retrieved using VDL and the JS API.
  • Hide an attachment using set_scen_attach_hidden, so that it is not visible in the attachments dialog in the web client until the user chooses to show hidden attachments.
  • Rename an attachment using rename_scen_attach.
  • List all the available scenario attachments by calling list_scen_attach, and retrieve information a particular attachment using scen_attach_info.
Note An app or scenario can have a maximum of 250 attachments, each of which has a maximum size of 300Mb. Large attachments should be uploaded in compressed (.zip) format. Scenario attachments are included when cloning and exporting the scenario.
Note While a scenario is queued or executing, the scenario attachments cannot be modified by another user. App attachments are not locked in this way, so care must be taken to ensure that changes to app attachments do not affect an executing model unexpectedly.

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.