Forum Discussion
FICO
5 years agoCommunity Manager
Issue with scenario attachments; attachment not found
Hello - looking for advice/help related to an issue with scenario attachments. we are using python to create several excel workbook files, which contain model input data. we have a set of strings (i...
FICO
5 years agoCommunity Manager
> I printed insightattachstatus and found that insightattachstatus=0.
Please note that INSIGHT_ATTACH_OK = 0. If insightattachstatus = 0, after calling insightputscenattach, this actually means that the attachment upload was successful.
> I can include code to skip any file that appears to have size=0, and this will avoid a run-time failure.
We need to explicitly create that run-time failure such that we see the error message that mminsight writes to the log file and such that we see the value of You need to
- either temporarily remove the code "to skip any file that appears to have size=0"
- or try the code that I provided below, i.e., replace the code "to skip any file that appears to have size=0" by fexists.
In case 1, we would get the run-time error, and we would see mminsight’s error message, that we need to understand the issue.
In case 2, I would also expect that fexists would return true for the "size=0" file, i.e., we would also get the run-time error.
So in either of the cases, we should get the mminsight error message, that we can forward to the developer.
(!@doc.
@descr Check if a regular file or folder exists.
@param filename The file name to test.
@return True if the regular file or folder exists.
!)
public function fexists(filename: text): boolean
declarations
status = getfstat(filename)
end-declarations
returned := status <> 0 and bittest(status, SYS_TYP) <> SYS_OTH
end-function
procedure set_attachment(filename: string, tags: list of string)
if fexists(filename) then
insightputscenattach(filename)
if insightattachstatus=INSIGHT_ATTACH_OK then
insightsetscenattachtags(filename,tags)
writeln("Attachment "+filename+" added to the scenario.")
else
writeln("Error adding attachment ",filename," (Status: ",insightattachstatus,")")
exit(1)
end-if
else
writeln("Error adding attachment "+filename)
writeln(" Filesize = "+getfsize(filename))
end-if
end-procedureRelated Content
Related Content
- 11Views0likes2Comments
