How to implement Automatic Business Publisher Update ?

by Mr. Se Hyoung Yoo (2011-03-02) in group We Love BPM

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.


Comments

by Mr. Freddy Barkhuizen (2011-03-08)

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=Fred
You 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.


by Mr. Krzysztof Kaminski (2011-04-14)

Hi,

 

Many thanks for describing this. Works for me!!

 

Chris


by Mr. Tim Dossett (2011-06-09)

Hi Krzysztof i am a newbie at this what should the "scriptrunner.bat" file contain to execute the "scriptrunner.cfg" file ?


by Ms. Kirill Tsarkov (2011-07-04)

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


by Mr. Freddy Barkhuizen (2011-07-04)

Hi Kirill,

Can you maybe send me your publish.cfg file?

Regards,

Freddy


by Ms. Kirill Tsarkov (2011-07-05)

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

 

 

 

 


by Mr. Sushant P (2011-09-13)

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


by Mr. Sushant P (2011-09-13)

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


by Mr. Jacob Zachariah (2011-09-16)

Hey Sushant,

 The above process does not create an export. It only updates an existing export. So you have to create the export first and then run this. I got the same issue as yours when i tried it first but got over it by creating an export.


by Mr. Sushant P (2011-09-19)

Hi Jacob,

The guidance was indeed very helpful for me.

Thank you very much.

Sushant


by Mr. Edmund Tan (2011-10-31)

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


by Mr. Roman Joss (2012-01-06)

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,


by Mr. Andreas Koch (2012-01-06)

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

 


by Mr. Andreas Koch (2012-01-10)

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


by Mr. Rik van der Schalie (2012-01-27)

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?


by Mr. Rik van der Schalie (2012-01-27)

Changed a few things (removed spaces from filename). Scriptrunner runs OK, but no output file.


by Mr. Misha Akopov (2012-02-15)

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


by Mr. Roman Joss (2012-02-15)

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.