My first ARIS report: Hello World!
Every developer knows a first step to learn a new programming language is writing a “Hello World” program. Today, I want to share with you how to write a small ARIS report doing exactly that.
Step 0 - Precondition
To write a new report, you have to switch to the module “Script” in ARIS Business Architect. There, you have to select an existing category in the folder “Reports” or create a new folder.
Step 1 - Creating a new report
Right click on an existing report category to bring up the context menu and select ”New\Report”.
A wizard is shown guiding you through the first steps to configure a new ARIS report. On the first page, enter the report name:
On second page, select a context (e.g. ‘Model’). The context specifies where the new report will be available. For example, if a report does an analysis on Access Diagrams, you can configure that the report can only be started on such models.
On the third page, select option “Enter source text (code view)”. ARIS also provides a WYSIWYG (“what you see is what you get”) report editor, but as we want to learn the programming language, we want to write the code on our own instead of generating it. You also have to select an output format for your report.
Now press the button “Finish” and the script editor is opened.
Step 2 - Write your first “Hello ARIS” report
Enter the following code lines in the script editor, save and close it. You will notice that the various parts of the code are highlighted to support editing.
var oOutput = Context.createOutputObject(); oOutput.OutputLn("Hello ARIS", "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0); oOutput.WriteReport();
In the first line we create an output object. This object offers all methods we need to write our output document.
In the 2nd line we add “Hello ARIS” to this output object.
In 3rd line we generate the output document by calling the method “WriteReport”.
Now, you can run this report on an arbitrary model and you will get a document with the selected name and format in the selected directory:
Here you can download the entire source code from the "Hello ARIS" report.
Note: This article describe how to develop a report in ARIS. See this post for links to similar articles.