ARIS Day Switzerland (German)
Register
ARIS Process Mining in action - Live Demo
Register

View all
RB

Hello,

I use a macro to start a report which create a XML file with some values. The report use the values and create a simple xml file. 

 

When I start the debug mode on the report, then everything works. It creates a xml file on following path:

C:\Users\****\Documents\ARIS 9.8

 

But when I start the report over the macro with "Report.execute(...)" -> then i can´t find any xml file. 

But  "xmlOutput.WriteReport()" return true, so the document has been successfully loaded...

 

 

Thanks!

__________________________________

//Macro code: 

selection = Context.getSelectedDatabases();  

(...)

var reportInfo = Report.createExecInfo("dc912610-b53f-11dd-59b4-b1c29b9461d4", selection, Context.getSelectedLanguage());

        reportInfo.setProperty("OBJEKT_NAME", oName);

        reportInfo.setProperty("OBJEKT_TYPE",oObjectType);

        var result = Report.execute(reportInfo, Context.getShowResult());

 

//Report Code:

var oObjName = Context.getProperty("OBJEKT_NAME");  

var oObjType = Context.getProperty("OBJEKT_TYPE"); 

var documentName = oObjName +".xml"

var xmlOutput = Context.createXMLOutputObject(documentName, "Root");

var xmlItem = xmlOutput.addElement(xmlOutput.getRootElement(), "ObjDef");

xmlItem.setAttribute("Name", oObjName);

xmlItem.setAttribute("TypeNum", oObjType);

xmlOutput.WriteReport();

 

 

 

by Rene Broll Author
Posted on Fri, 03/22/2019 - 11:45

I found my problem...

You have to set the selected format and the file.

 

so your code in the report have to be like this:

//Report

Context.setSelectedFormat(Constants.OutputXML); 



var oObjName = Context.getProperty("OBJEKT_NAME");  

var oObjType = Context.getProperty("OBJEKT_TYPE"); 



var documentName = oObjName +".xml"

Context.setSelectedFile(documentName)

var xmlOutput = Context.createXMLOutputObject(documentName, "Root");

var xmlItem = xmlOutput.addElement(xmlOutput.getRootElement(), "ObjDef");

xmlItem.setAttribute("Name", oObjName);

xmlItem.setAttribute("TypeNum", oObjType);

xmlOutput.WriteReport();

 

0

Featured achievement

Genius
You like to help others solve their problems by answering questions.
Recent Unlocks
  • KF
  • KH
  • RG
  • Profile picture for user Vee_ARIS
  • Profile picture for user smarty
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock