ARIS Community - We Love BPM

How to extract the messages of the "BPExportResult.getMsgs()" ?

OriBPM's picture
by Ori . in Reports & Macros posted on 2017-02-09

Hi,

I'm making a report to refresh every day a DB in the Business Publisher Server.

It works fine but I can't find the way to read the messages of the result.

Short Code:

publisher = Context.getComponent("BusinessPublisher");
readonlyDB = ArisData.openDatabase(BD_NAME, true);

infoUpdate = publisher.updateExport(readonlyDB, PUBLISHER_SERVER, EXPORTATION_BD_NAME);

var foo = infoUpdate.getMsgs();

 

The problem is the result of "getMsgs()" (Collection <Message>) in the "Report class BPExportResult"

foo.get(0) // Output: com.aris.modeling.common.core.progress.Message@7a88b227
foo.get(1) // Output: com.aris.modeling.common.core.progress.Message@475dd97f
foo.get(2) // Output: com.aris.modeling.common.core.progress.Message@2ba43e2c

How can I read this messages ? :S

 

Many Thanks.

1862 Views
0 Likes
2 Comments
There are no attachments
Gerald Schroeder posted on 2017-02-10

Hello Ori,

don't know actual something about getMsgs();
but I use the following commands to get duration and success of the Publisher-Update:

aResult= publisher.updateExport(someparameters):

var aOutput     = Context.createOutputObject(Constants.OutputTXT, aFileName);
aOutput.OutputLn("Duration=" + aResult.getDuration() ,"Tahoma",18,0,-1,1,0);
aOutput.OutputLn("Success=" + aResult.isSuccessfull() ,"Tahoma",18,0,-1,1,0);

.... and then write it in a file like this:

aOutput.WriteReport();

var oData = Context.getFile (sFileName, Constants.LOCATION_OUTPUT);
var dir = new java.io.File(aFolder).mkdirs();
var oFile = new java.io.File(aFolder+aFileName);
var oOS  = new java.io.FileOutputStream(oFile);

if (oData!=null) {
    oOS.write(oData);
    oOS.close();
}

Best regards
Gerald

Ori . posted on 2017-02-14

Many thanks Gerarld for answering, I was already using these 2 functions only I was missing this one...