Never mind, it seems that it is not possible to create this kind of directory structure on the client computer. So, I tried different approach - I'm generating the files on the server and I'm saving them under Context.getTempPath() directory.
Then I ZIP them into single archive and I get the ZIP at the client with Dialogs.shell(). The ZIP file is opened on the client's computer, but the afterwards the Dialogs.shell() method gives error:
"Script: , line -1"
Are there any known issues about Dialogs.shell() method?
Dialogs.shell() - this code is not in report, this is in macro, isn't it?
Did you get this error "Script: , line -1" when you run macro on group from Explorer? Because usually this error appears in code editor only.
Hi Vladimir and thank you for your response.
Dialogs.shell() code is in the report. The reports API ptovides access to Dialogs, so it is possible to collect additional information, show messages, etc.
Yes, I get "Script: , line -1" only in editor, but if I run the report in Explorer the BPA client hangs and has to be restarted forcefully. I posted more detailed article about this in Aris Support Group: http://www.ariscommunity.com/users/skirov/2012-01-09-report-script-bug-dialogsshell
Did you send this problem to ARIS support?
you can create this subdirectory structure (as you wrote in article) on server, because reports run on server.
Since we are using Oracle BPA 11g which uses the ARIS engine, I guess we will have to send the problem to Oracle, not to ARIS Support. For now the workaround we figured-out is solving our problems.
Thank you for your cooperation!
You could initiate the report from a macro. In the macro you determine which models need to be exported, you create the output dir and run the report for only the selected models in one group. This wil result in output to the wanted directory.
Thank you for your suggestion!
There are two methods for saving the files to some specific folders on server. I am explaining one of it. You need to find out how to bring those files to client machine. There can be many ways to bring the files on client machine, you can take help of Macros also by setting the return Property from report. Or through any other desktop app.
I am considering that you have JDom Document object, returned by your method
var doc = createXMLDocument(models[j]);
Here after this you can do the following steps
1. Import file "convertertools.js" in script from Script properties.
2. Use the followin code to save it to specific location
var l_XMLOutputter = org.jdom.output.XMLOutputter(); __createDirectory("C:\\Group1\\Group2"); var l_FileOutputStream = java.io.FileOutputStream("C:\\Group1\\Group2\\test.xml"); l_XMLOutputter.output(doc, l_FileOutputStream); l_FileOutputStream.close();
The other way is to create files using Java File writer, writing simple text files with XML tags in it, if the XMLs you are generating are in the custom format.