Hi,
We want to update automatically business publisher exports on a specific scheduled timing.
I have read some related articles but there is not enough explanation to how to implement it
(ex, how to customize "Script runner" ?)
Please, help me to solve this problem. I need a detailed step-by-step guidance.
Thanks for your kind advice.
Good Day,
First create a new Report and set its Context to Database
Set the Output of the report to Text File
Add the following as the code:
var aOutput = Context.createOutputObject(); aOutput.Init(); var sServerAddress = Context.getProperty("ServerAddress"); var sExportName = Context.getProperty("ExportName"); if(sServerAddress==null){ aOutput.OutputLn("ServerAddress not defined" ,"Tahoma",18,0,-1,1,0); } if(sExportName==null){ aOutput.OutputLn("ExportName not defined" ,"Tahoma",18,0,-1,1,0); } if(sServerAddress!=null && sExportName!=null){ var oBusinessPublisher=Context.getComponent("BusinessPublisher"); oBusinessPublisher.activateExport(sServerAddress, sExportName, false); var aResult = oBusinessPublisher.updateExport(ArisData.getActiveDatabase(), sServerAddress, sExportName); oBusinessPublisher.activateExport(sServerAddress, sExportName, true); aOutput.OutputLn("Duration=" + aResult.getDuration() ,"Tahoma",18,0,-1,1,0); aOutput.OutputLn("Success=" + aResult.isSuccessfull() ,"Tahoma",18,0,-1,1,0); aOutput.OutputLn("ServerAddress=" + sServerAddress ,"Tahoma",18,0,-1,1,0); aOutput.OutputLn("ExportName=" + sExportName ,"Tahoma",18,0,-1,1,0); } aOutput.WriteReport();
Now you need to create a Config file to be used with scriptrunner.bat. I create the config files in the same folder where scriptrunner.bat is located. On my machine it is C:\Program Files\ARIS7.1\server.
I call my config file SR-UBP.cfg
Add the following in the config file:
#server home directory (to be changed if needed) #example: server.home=D:/Program Files/Aris/Server server.home=. # ARIS server to connect to. Defaults to 'localhost' scriptrunner.servername=localhost # Database name to login. scriptrunner.dbname=20100615 Development # Username for login. scriptrunner.username=system # Password for login. scriptrunner.userpassword=manager # Methodfilter for login. Defaults to "entire method" scriptrunner.methodfilterguid=2fee0f80-fb7f-11da-6b7e-001143d3f402 scriptrunner.dblocale=en scriptrunner.clientkey= scriptrunner.oemprofile=oem01 scriptrunner.guilocale=en scriptrunner.scriptid=Fred/e4bda1e0-93de-11df-0bbd-000c2987d684 # Outputformat ID, defaults to -1 (no output) # 0 = RTF # 2 = Text # 3 = HTML # 4 = MS Word # 5 = MS Excel # 7 = other # 8 = XML # 9 = PDF # -1 = No output scriptrunner.outputformat=2 scriptrunner.outputfile=C:\\Temp\\Update-Business Publisher.txt scriptrunner.evaluationfilterguid= scriptrunner.scriptinput=DB scriptrunner.userproperty.count=2 scriptrunner.userproperty1.key=ServerAddress scriptrunner.userproperty1.value=127.0.0.1 scriptrunner.userproperty2.key=ExportName scriptrunner.userproperty2.value=FredYou now need to modify the following properties:
scriptrunner.dbname=# The Database name you want to connect to. scriptrunner.username=# Username for login. scriptrunner.userpassword=# Password for login. scriptrunner.methodfilterguid=# Methodfilter GUID for login. Defaults to "entire method" scriptrunner.clientkey=# The Lecense Key to use, can be a IT Architect, Business Architect, IT Designer, Business Designer Key, etc. scriptrunner.guilocale=# Language Locale code scriptrunner.scriptid=# The identifier of the report you created above scriptrunner.outputfile=# The Path where you want to store the output text file(.txt) of the report, remember to use \\ instead of \ scriptrunner.userproperty1.value=# The server address, for localhost use 127.0.0.1 scriptrunner.userproperty2.value=# The Business Publisher export name
To get the the Identifier of the Report, you can right click on the Report and select Properties
Once the config file is set up, you can test it using the scriptrunner.bat in the command line
If it is working like expected you can create a task for it in the Windows Task Schedular.
Hope this helps you.
Hi Freddy,
I followed the above instructions to run the publisher automatically. But I observed that scriptrunner SR-UBP.cfg is running successfully but it's not generating any export file in publisher folder.
When I looked into the log files, its showing only the below information.
Duration=0
Success=false
ServerAddress=10.219.107.111
ExportName=Sushant
Please advice, why the database is not exported to the publisher folder. Thank you.
Regards,
Sushant
Hi Freddy
Could you please help - is it possible to debug what is really goes on inside scriptrunner?
The publish script (you provided) works perfectly when it is run directly from BA. But when I try to start it from scriptrunner.bat the followning message appeares:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\gren-a-kstsarkov>cd C:\ARIS7.1_NEW\server
C:\ARIS7.1_NEW\server>scriptrunner publish.cfg
ERROR: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at com.idsscheer.aris.cscommon.scriptrunner.AScriptRunnerBase.run(AScrip
tRunnerBase.java:406)
at com.idsscheer.aris.cscommon.scriptrunner.AScriptRunnerBase.run(AScrip
tRunnerBase.java:103)
at com.idsscheer.aris.server.tools.scriptrunner.AScriptRunner.main(AScri
ptRunner.java:41)
Can I get more details about the problem (debugging, log files and so on),
Thank you very much,
Kirill
Hi Freddy,
Actally today, when I got template from \server\templates and fill it, the task starts to work. I think that there was some junk symbol or so on in the original version of config file, but I deleted the wrong file in my joy :).
Thank you very much and sorry for my hurry and unprepared question.
Kirill
Hi,
I followed the above instructions to run the publisher automatically. But I observed that scriptrunner SR-UBP.cfg is running successfully but it's not generating any export file in publisher folder.
When I looked into the log files, its showing only the below information.
Duration=0
Success=false
ServerAddress=10.219.107.111
ExportName=Sushant
Please advice, why the database is not exported to the publisher folder. Thank you.
Regards,
Sushant
Hi Freddy,
Thanks for sharing your script for the export update automation. It's been very handy
I've noticed a strange behaviour occuring with either your script or the system executing the script(what makes this even more infuriating is that it's intermittent).
I'm wondering if you've experienced this before? At times when the script executes the export for some reason or other defaults to a locked status (locked vs. active). Thus requiring manual intervention in Business Architect to allow the export to be visible in BP.
Is there a a switch or attribute that controls that behavior that you are aware of?
I'm running the current version of ARIS and ARIS BP.
Edmund
Hi there,
Just for an alternativ solution: i work with version sr 2010-08 and here is an possibility to define timebased reports (in German: Zeitgesteuerte Reporte). So you can define a time, when a specific report should be run. So i let run the report for updating the existing publisher-exports on this way. It works absolut fine.
regards,
Hi Roman,
have you tried to use the Scheduled Report for multiple Publisher Exports?
I tried the same with ARIS 7.2 and the scheduled export only runs once but not at the scheduled time. I asked the IDS Support for help, but they told me that the report scheduled can not be user to update existing publisher exports or to generate a new one.
Until today I have no real solution to automatically update exsiting Publisher Exports.
Using the scriptrunner config file solution above I also receive this error mesage when executing the scriptrunner:
ERROR: -1
java.lang.ArrayIndexOutOfBoundsException: -1
Regards,
Andreas
Hi,
I made it today with the report and the scriptrunner config file explained above.
The issue was, that there were some spaces at the end of the config values and so the scriptrunner could not handle the license or the db name. I corrected it using the scriptrunner config template from /server/templates and edited the values as explained.
Now I just copied the config file and changed the db name, user account and filter to use the it for more then one Publisher Export.
It is working fine for me.
Thank you very much for providing this solution.
Andreas
I'm having trouble getting this to work. Now, There is a space in the name of the output file in this example, and we've got a space in the database name. Might it be necessary to enclose the database name in the SR-UBP.cfg (line 9 in the example, although the example also has a space in the database name) in quotes?
Hi ,
I tried to run this bat file on server , but it says
java.lang.IllegalArgumentException: hardkey contains a server key, but scriptrun
ner needs a client key!
In scriptrunner.cfg scriptrunner.clientkey I wrote key of designer . do I wrote somethig wrong ?
The license key is written in help->about right ? It has format :
scriptrunner.clientkey = XXXXX- XXXXXXXXXXXXXXXXXXXX - XXXXXXXXXXXXXX
to Andreas Koch:
Excuse my lat answer.
As Mr. Zachariah mentioned, the report can not create a publishr-export, but can update an existing export.
That works absolutely fine. IDS delivers a generic report in the report-group 'Business Publisher'. This one i enanced with export-specifica for each export i have and then i configured them with the timebased report-configuration.
Everything works fine and it's configurable from each aba-installation.
Hi Guys, I wanted to update automatically export business editors at a specific time set too. But I can not implement what our friend Freddy Barkhuizen, explained in step-by-step above. When I run the command "ScriptRunner name_file.cfg" at the prompt, the following error appears: ERROR: (40171) Unable to connect to server: Server does not allow connection to your client. Can anyone help me in resolving this error? Thank you for your attention.
Hi guys, I managed to solve the problem described above. In "scriptrunner.servername = localhost" I put the server name instead of "localhost" and apparently solved this problem. But a new error appears: ERROR: (40109) Your license key is invalid. Does anyone know tell me where I find the license key? Thanks you for your attention.
Hi Danilo,
as valid license I used a Business Architect license string that I currently do not need for any active user.
I think the scheduled Publisher Exports should also work with a normal Designer license if the user you are using for the connection has sufficient permissions to perform the Export.
Regards,
Andreas
Hi Freddy,
I am not able to find the scriptrunner.bat batch file anywhere on my local, all I can find is scriptrunner.cfg file. So when it comes to the step of testing the SR-UBP.cfg file in the command prompt, it says not recongnized.
Any idea on how can I move forward ?
Hi guys, Sorry for the delay in return I was too busy, just wanted to say thank you and let you know that I could solve my problem. I opened a call with Oracle to get the license key that was requested and is now working eprfeitamente. Andreas Koch, Roman Joss, thank you for your support and Freddy Barkhuizen thank you for the excellent post. Regards, Danilo Risme.
This post works for me 100%. Well documented and good example. Kudos!
The only config file parameter I didn't guess right on the first try is ServerAddress value pair. Second try worked with the Business Publisher server's domain name.scriptrunner
.userproperty1
.key
=ServerAddress
scriptrunner
.userproperty1
.value
=
<use BP's domain name>
We also used \\ in the paths in server.home in the config file.hi,
Thanks for the help. I havent managed to get it working yet but you have gotten me much further than before.
In response to other posters:
1. I could be wrong about this but the scriptrunner.bat is in the <ARIS install folder>\server. it is only available on machines with the business server installed.
2. I also used an ABA key and it worked.
Hi Roman,
Thanks for the prompt response.
I am not much aware of stuff in ARIS. Is there any step by step guide or if possible can you guide me through the steps.
I tried all steps mentioned above but didn't get the expected output.
I created this on the server hence i put 127.0.0.1 for server address and exportname i just put in random.
Hi,
Thank you all for helping me get this working. Highly appreciated
Mr Yaghwinder. I was having the same problem as you but I reallised that the server address should not the the ARIS Business Server address but the ARIS Business Publishing Server address. I hope that helps you.
Hi,
I've got this working on smaller test databases - but when trying to run this on our production database i get the error below. Any help?
Could this be related to the db size or something like that? Incidentally - My test export off the small db takes 199 seconds to create or update using ABA but if I script it and run it through the script or scriptrunner, it takes more than 3000 seconds. If you extrapolate this to my prod db its scary.
THe script I'm running is
Hi Freddy Barkhuizen. I really want your help. I have problem with the code I do not know.
When I run script is working ok. But output file gives me this output.
====================================================
ServerAddress not defined
ExportName not defined ==================================================== I do not know why is not taking server address and export Name: =================================================== scriptrunner.outputfile=C:\\Temp\\UpdateBusinessPublisher.txt scriptrunner.evaluationfilterguid= scriptrunner.scriptinput=DB scriptrunner.userproperty.count=2 scriptrunner.userproperty1.key=ServerAddress scriptrunner.userproperty1.value=127.0.0.1 scriptrunner.userproperty2.key=ExportName scriptrunner.userproperty2.value=KTZH_Model =================================================== Thank you.Hi, I just installed Aris 9.8 and running the report makes the error :
script Export Business Publisher, line 11: Can't find method com.idsscheer.report.output.outputobject.asposeapi.AStandardDocument.Init(). (Export Business Publisher#11) com.aris.modeling.common.serverremoteapi.cscommon.scriptrunner.AScriptRunnerBase.logErrors
I simply removed the instruction : " aOutput.Init(); " from the publisher report and it seems working.