Report Documentation
Report Documentation
model
?
var model = ArisData.getSelectedModels()[0];
1var mergeComponent = Context.getComponent("Merge")
2
var result = mergeComponent.createVariant([model],
3
model.Group())
You can find a description of the Merge component in the ARIS script help:
Help -> Aris Script -> Methods for reports and semanticchecks -> Objects -> Report component interfaces ->
Merge
How to insert a model graphic into your report. All models of the selected groups should be
output as a graphic.
First of all, you must insert a new subsection in the repetition area.
Right-click in the repetition area of the subsection of the Selected groups query, and select Insert/Section here.
Click on Next and select the Model list (filterable by type) item under Items of: Selected groups and click on the
Next button. Now you can select a model type (if you want to output only a special model) under Model types in
the Parametergroup box. In our example, all model types are output. If you want to include subfolders, you must
enable the Recursiveoption. Select Name in the Sort by selection box. Click on the Finish button.
A subsection is inserted with a query for all models of the selected groups.
Now insert the model name as a heading. To do this, enter the text "Model name:" in the repetition area of the
new subsection, then add a data field.
Select Name under Items of: Selected groups.Model list (filterable by type), then click on Next and Finish. A
heading with the respective model name is inserted.
Insert a line break behind the heading, and then insert a data field with the Graphic element under the heading.
Now your report outputs all model graphics of your selected groups.
USER ADMINISTRATION
In OBPA, you must create a user for every employee which should have access to the ARIS repository.
1. Open the module Administration by clicking on the corresponding icon in the module bar and log in to
the database.
First of all you must insert User name, Full name, …. If you have filled in all fields select Next.
You can assign the user to the groups of your database in the second step.
The difference between using the WYSIWYG editor to create a script and directly programming it using
JavaScript code. Lets focus on the overall structure of WYSIWYG editor.
In the WYSIWYG editor you can define the content and layout of your reports based on report script templates.
The templates provide sections and subsections, headers and footers, and an optional cover page. You can add
various elements to these structural elements, such as queries, data fields, data tables, text boxes, formatting
tables, text, images, charts, or hyperlinks. Formatting tables are available that you can use to place and arrange the
relevant elements in sections and lines.
Report script templates provide a schematic representation of the report's content and layout, with individual
placeholders being inserted for query components such as data fields, data tables or charts. When the report script
is run, the corresponding data is inserted and later displayed in the final report.
Sections
The basic structural elements of report script templates are called 'sections'. In these sections the data to be
evaluated is defined by means of queries, and layout components such as headings or images are inserted.
Example: Section
In a section you can define that only the EPCs of a selected group are queried. The data of these EPCs then serves
as the basis for other queries, for example, a query returning all functions of the relevant EPCs or their names.
Context
When creating a report, you first select the context (e.g., groups or models) and thus define the database items for
which a report can be run. For each selected context, a corresponding section is automatically created on the
highest level of the report structure, into which queries can be inserted subsequently.
Example: Context
If 'Database' was defined as the context of the section on the highest level of the structure, you can run the report
for selected databases. If a second section has 'Group' as its context, it is possible to run the report also for selected
groups. If the report is run directly for a group, no queries are run for a database.
Subsections
Subsections serve to supplement and nest queries.
Then you can assign identifiers to the user. By assigning a prefix you can identify the users or user groups that
have created database items. Prefixes in combination with a sequential number are assigned as identifiers and
specified for the Identifier attribute. Each user has a prefix. If no individual prefix has been explicitly assigned to
users, the standard database prefix is assigned automatically.
In this tutorial, you want to iterate over a set of groups and output the name of the models contained in those
groups. First, you select “Group” as the context while creating the report. This means that the report can be run for
a selected list of groups.
To output all models of the selected groups, you define a query. This query is a subordinate query that searches
through the selected groups.
Right-click and select “Insert/Query”. You can set queries for both the repetition area and the static area of each
section.
To output all models of the selected groups with their name, you need a query for therepetition area. Enable the
"Has repetitions" option.
Under 'Available data', select 'Model list (filterable by type)' and click on the 'Add to repetition' button. You can
insert only one query into the repetition area.
Click on the "Next" button, select the 'Selected groups.Model list (filterable by type)' query and click on "Finish".
The query will be inserted into the selected area.
Select 'Name' in the 'Select data' field, click on the 'Next' button and then on 'Finish'. Now the data field shows the
text '{Selected groups.Model list (filterable by type).Name}'. To specify the output, the prefix 'Model name:' is
added in front of '{Selected groups.Model list (filterable by type).Name}'. To output the name of the group
another data field is required. The procedure is the same as the one described above. Here, we insert a data field
with the path 'Group – Name'
Click on "Next" and on "Finish".
For a better output, set the second data field in brackets. Now you have finished the first tutorial.
The output of the tutorial shows all selected groups with their models. Here is a sample output:
In the next step you assign your new user privileges. The user in the example is assigned the “Database
management” privilege and has the privilege “Change management” assigned via a group. The user now has the
privilege to edit database attributes and create, modify, and delete languages.
Then you can assign method filters to your new user. The default filter of the database is automatically assigned to
the new user, as well as the group filters.
In the last step, you can review the settings of the new user and confirm them by clicking the Finish button. The
new user is added.
You can change the assigned function privileges, filters and user group associations at any time by editing the
now existing user.
In this tutorial, you want to iterate over a set of groups and output the name of the models contained in those
groups. First, you select “Group” as the context while creating the report. This means that the report can be run for
a selected list of groups.
To output all models of the selected groups, you define a query. This query is a subordinate query that searches
through the selected groups.
To output all models of the selected groups with their name, you need a query for therepetition area. Enable the
"Has repetitions" option.
Under 'Available data', select 'Model list (filterable by type)' and click on the 'Add to repetition' button. You can
insert only one query into the repetition area.
Click on the "Next" button, select the 'Selected groups.Model list (filterable by type)' query and click on "Finish".
The data field in the 'Selected groups.Model list (filterable by type)'repetion area of the subordinate query should
output all model names and their associated group name.
Select 'Name' in the 'Select data' field, click on the 'Next' button and then on 'Finish'. Now the data field shows the
text '{Selected groups.Model list (filterable by type).Name}'. To specify the output, the prefix 'Model name:' is
added in front of '{Selected groups.Model list (filterable by type).Name}'. To output the name of the group
another data field is required. The procedure is the same as the one described above. Here, we insert a data field
with the path 'Group – Name'
Click on "Next" and on "Finish".
For a better output, set the second data field in brackets. Now you have finished the first tutorial.
The output of the tutorial shows all selected groups with their models. Here is a sample output:
How you insert an attribute list as a data table.
The sample report will output a list of the functions contained in the individual models. It also includes the
specified time and cost values.
To obtain this output, you must insert a data table into the repetition area of the selected model query. The data
table queries all functions of the model and outputs the name, time and costs of the functions using data fields.
How it works
Right-click in the repetition area of the subsection of the selected model query (how you insert a query will be
explained in this article), and select Insert/Data table.
Under Settings, enter the number of required columns, in our example 4. Then enable the Has header and Repeat
table header on each page options as well. Click on the Next button.
Select the Object definitions (filterable by type) item under Items of: Selected groups.Model list (filterable by
type) and click on the Next button.
Now select Function under Object type in the Parameters group box. To get a sorted output you can select Name
in the Sort by selection box. Click on the Finish button.
A new subsection is inserted with a data table that queries the functions of every model.
Now you can format the header of the table. To do so, select the first row of the data table and right-click on the
selected cells, and then select Properties. Here you can set the background color of the table header, for example.
In the headers of the individual columns, insert the following titles: Model name + Model type, Function, Average
processing time, and Average total costs.
Your first row of the data table then looks like this:
To be able to output the data you need to have data fields. Therefore, right-click on the second row underneath the
title Model name + Model type, and select Insert/Data field.
Select the data element Name from Data superior to ‘Query’ folder and click on the Next button. Finally, click on
Finish.
A data field listing the model name is inserted. To specify the model type you can insert a data field in the same
way behind the name of the model. Select Model type as the data element. Separate the two data fields with a "-".
In the second row of the Function column, insert a data field with the data element Name that you select under
Items of: Selected models.Group.Model list (…). Click on Next and on Finish.
A data field that lists the function names of every model is inserted.
In the third row of the Average processing time column, insert a data field with the Attribute (filterable by type)
data element and the Average processing time attribute type.
The last column Average total costs is filled with information in the same way.
The queries are inserted into the second row of the data table. The report should look as follows:
The output of the report may look like this:
In combination with the previous tutorial, you can now first query a list of models and second output specific data
for each model like a list of certain objects with selected attributes.
CREATING USER DEFINED SYMBOLS
Even with the variety of symbols on ARIS platform there are situations where we face the following problem:
none of the symbols represents exactly what we want, so what to do? Answer: use the ARIS Symbol Editor.
1) Go to Start / Programs menu and choose ARIS Platform / Administration / ARIS Symbol Editor 7.0.
3) Double click over the symbol that is closest to what you need. The symbol is added at the end of symbols' bar:
4) Click once over the added symbol at the symbols bar and once in the center of the work area. The new symbol
will be added for editing:
5) Click once in the center of the symbol, right click and select Properties:
Note: In addition to changing the properties you can add several elements such as images, shapes and text.
7) Check the results:
By default the tool also lets you import images in various formats such as GIF, JPG, BMP and EMF.
Note: This article involves changes in the standard files, for this reason I recommend to make a backup of
those files before save it.
ARIS platform has a huge variety of standard reports for different goals and contexts (around 100). One of the
most widely used customization is the change logos that are generated in the reports.
Most standard reports in Word / PDF use basically two images in the header: one on the left side and one on the
right:
There are two ways to change the logo..
I would like to show you another way to get the same result.
For our example we need two images in any of the following formats: GIF, JPG, WMF or EMF:
Tip: You can google and download a small image, duplicate it and rename both.
1) Open ARIS Business Architect, go to the Administration module / [server] / Evaluations / Common files and
click the Add button:
2) Add the two images to be used as the logo and check that they appear in the common files list.
5) Find the line with pictleft / pictright as below (around line 1663). A shortcut to go to there quickly is using the
keys: CTRL + G (Go to line number):
Note: If the file has any previous update the line number may vary.
6) Copy the two lines marked up and duplicate them like in the image below:
7) Add the characters "/ /" (slash) at the beginning of lines 1663 and 1664 (it may be another lines for you). This
action will comment the lines in case you want to go back to the original configuration of the tool:
8) Replace the contents of the parentheses to the names of the pictures you've created before. Do not forget the
quotes "":
10) Run a standard report such as Model Information and you will see the final result:
Option 1: Create Report with the Report Wizard.
Please see the online help, group "Create scripts", "Use case", "Use Case: How to work with report script
template". Additionally please also review the file "evaluation_s.pdf", available from the ARIS installation disk,
subfolder "Docs" (sections 5 Reports and 8 Scripts).
We are going to explain the main steps right in the next articles in this serie.
Option 3: Create Report with the Report Wizard, but needs to be enhanced.
This request is very common, you like to get a certain option, a custom dialog window etc. In this case you may
start with the Wizard, but then you complete it with Java Script.
This way would probably save you a lot of time. If you have a good example, already quite matching, you can use
that and change it according to the requirements. The report can be created with the Wizard or with JavaScript.
We are going to explain the needed activities in more detail for the options 2, 3 and 4 right here in this forum.
What we are going to do is this listing, a plain list of main model attributes + attributes from selected object
occurences. To run it, open a model of your choice, select one or many functions and run the report, You will get
a list like this:
Now, let's start how to build this:
Step 1: Create, if not yet done, a new Category for your custom reports.
Step 5: Select the objects you are going to list in the report
Excel is not yet supported by this report, therefore we select plain text only (PDF, ...)
Continue with wizard step 4 and click on [OK]
Hint: If you select here "Enter source text (code view), then you can continue directly with step 9. In this case no
layout will be created. Please make sure that you are selecting at least PDF as output type.
The wizard assumes that you are going to create a report with layout, therfore some content data are already there,
but ...
Usually a code starts with some constants. In this case it is a language constant (we need it to read the attribute
names correctly).
Below that we start immediately with the main function. In fact it will not be called here, but it will be defined.
With the Context we define a handler for the outfile, set the format we are going to use and get a list of all
selected objects.
If at least one object has been selected, we will continue and loop through this list. The current object we track in
currObject.
To make the report a little bit more complete, we are reading some general values like the model name, the group
etc. And also the current filter.
We will now print the selected data above immediately (to be precise: prepare for printing).
And will now take care about the object attributes itself. In this first part we list only maintained attributes. A
custom function will provide this information. The print out is again a list.
In a second part we are printing the oposite, which means all not maintained attributes. You see this small ! in
front, this will do the job for us.
A little bit of summary, and a final go for the report to write.
Below the closing "}" we have some helper functions. This simple function will determine if the attribute is
maintained or not.
Because the engine does not recognize the main function automatically, we have to call it here.
How to start?
Open a model, click on one or on multiple objects in it, and select "Evaluate" > "Start Report ...". Select your
report category and let it run.
Final note:
This tutorial helps you to get a better understanding how JavaScript works inside ARIS. You may find easier or
better solutions to provide the same - please use this community to share your thoughts. I am going to extend this
first version step by step and will make it more complete.
Download
Please download the report file from here
Next Article
In the next article we are going to change the output to Excel and will discuss special enhancements to get a nicer
output.
you may have asked yourself already why it is necessary to work with JavaScript, if we could achieve the same
with the Wizard. To give an answer, I just tried it out and it looks quite good. It was my wish to print all
information as we have it in the Part 2 - Object Attribute Listing.
We will get also the same data with output type "Excel", splitted into 3 different sheets, whereas in my example
the first two are empty:
What is the main difference between the JavaScript report and this Wizard generated?
With the Wizard I can create a nice layout, define it on the screen and don't care individual positions and ARIS
JavaScript functions. Although I miss the ID's and API values, the main information is there.
The main point that I can not solve is the dynamic list of "all maintained attributes". I need to select all possible
attributes manually, and in case an attribute is maintained it will be printed.
What I can not achive at all is the list of "not maintained attributes". I just don't know if this is possible with the
Wizard.
Report Definition
Here is the report definition as I see it right now. As usual I started with the "selected groups", added a subgroup
for the models and another for the object occurences with the attributes:
Please feel free and create your own Wizard report and try to get the same result. Mainly I followed the steps from
the evaluation user guide "evaluation_s.pdf", section "8.1.28 - Use Case: How to work with report script
templates". If requested, I would be pleased to describe the individual steps in more detail.
Download
After creation (or installation), select a group in your database, right click, then Evaluate > Start Report ...
Open Point:
Does someone know how we can add the attribute group automatically to the attributes? This value seems not to
be available in the Wizard, but perhaps in JavaScript?
Next Article
The next article will further enhance the report and add Excel as output format (see Tutorial Part 4).
Whereas the data are similar to the previous tutorial (see Part 2), we are now going to create an output like this:
In fact it is not only Excel, also the HTML output can be enabled for your report - you know where to define this?
Additionally I am going to bring up a warning if someone selects PDF, so just enable PDF also please.
We will have this function still on the end of our script, and will just add some more lines here.
Step 2: Constants
Now we are moving up and add some more constants here. There are two different types, arrays to hold the sub
table headers and widths, but also two boolean variables to enable or disable certain code sections.
Step 3: Fixed Excel File Name
Let me introduce an option how you can define a fixed file name for dedicated types. If the constant in line 28
would be set to true, the file name will always become the report name itself (and no more the generic name).
In all other cases we use the default file name. Please look up other Constants like OUTEXCEL in the Script help.
Hint: To enter the needed help quickly, select the word createOutputObject, press F1 and choose the
corresponding parameter set (in our case the second would be right). The upcoming help screen tells you exactly
what Constants you can use additionally.
To get this title in a html output (window and tab title) ...
... we add one more statement right here:
Our code does not yet support PDF. To handle this, we add a warning in case someone starts it in PDF mode:
Then we open the table writing (line 83).
Regarding the 4 last lines: The first Excel cell in the output shows the title in light brown. This title spans over 2
cells. Because the PDF generator does not support this kind of format, we need to add another "if" statement here.
You may now add lines for the model information. As we can see, there are always the same lines to fill one
single cell.
A better approach would be creating a separate function and handle these 3 lines there:
Finally our model information section looks like this, much more compact and easier to maintain:
This section will always appear. We use now the two defined arrays, and the additional styles.
Only in case we are not in PDF mode, we are closing the table here. In case of Excel this EndTable will close the
first sheet.
If you like to get also a table with not maintained attributes, please set the constant from line 26 to true. All other
code lines are quite similar to Step 7.
Now, because we support Excel, our error handler should also use the table commands.
That's it!
How to test?
As before, select one or many objects in your model and then Right mouse > Evaluate > Start Report ...
With the ARIS “Model Comparison” report you can generate personalized answers to questions such as:
The report executes a model comparison. As input, it takes ARIS diagrams and compares them based on
configurable criteria. It produces for you a set of Excel worksheets or HTML tables describing the changes and
also, if you wish, a new model which shows you a graphical comparison of the changes. You can start the report
on a single model or multiple models.
Model comparison gets much easier when using the ARIS Model Comparison report. A configurable user-friendly
setup provides you with easy-to-understand information. You get graphics of the compared models (1 to 1) as well
as a summary of changes with hyperlinks to the detailed changes described in separate tables. You can decide on
which things you want to compare (objects, attributes, etc) and also whether you want to compare occurrences of
the same object or copies of objects with the same names or attributes. You can also compare models in different
databases.
To get started, download the ARIS Model Comparison report and save it on your hard disk. Please note, you
can only download the report if you are currently logged into the ARIS Community.
Make sure that you have ARIS Business Architect, because you need the administration module to import the
report. In you only have ARIS Business Designer on your PC, you must ask your ARIS administrator to install the
report for you.
For more information about downloading & setting up reports and macros in ARIS, read my previous article
“Reports and macros in ARIS”.
After download and installation, you can start the report in the normal way on a selected model or models (right-
click and select Evaluate and then Start Report).
Report output
When you start to run the report, the Report Wizard will give you the option of two output formats, HTML or
Excel. The HTML output generates a web page with several tables. The summary table (at the bottom of the page)
gives an overview of changes with hyperlinks to other tables on the page which show detailed information.
The Excel output provides the same information, but each table is in a separate Excel Worksheet. The summary
sheet includes a list of changes and if you click on one of the changes it opens one of the object, attribute or
connection comparison worksheets which gives more information about the change.
Whichever format you select will get the option to choose which information you want to see:
You also have the option to display a graphical output. This creates a new model in ARIS that displays the two
models being compared, side by side, and highlights where the changes have been made.
Running the Report
When you run the report you will configure how the comparison information will be displayed.
If you select several models to compare you will be asked to choose which one is reference model against which
all the others will be compared. You can also choose whether you want to create the model that has the graphical
comparison of the models. If you select this option the report will tell you the names of the models it created
(don’t forget to delete them when you no longer want them). If you selected more than two models to be
compared, then several comparison models will be produced. Each model will be compared against the reference
model in turn.
If you only select one model, a slightly different screen appears. This time you select what type of model to
compare against the model you selected. You can choose:
The variant, master or attribute comparison can also be done with models in another database if you wish (check
the Database box and choose the database). You can only do the GUID comparison with another database.
Next you choose the object comparison options. Normally you will want to look for the existence of new objects
in models (or their deletion). If you have definition or variants copies of objects then you can also choose to look
for attributes that are newly maintained or updated, either on the objects or their connections (see below). If you
click the Restrict Objects Types box then you will get another screen asking you which type of objects you want
to include in the comparison. For instance you could search for changes that just affect Applications System Type
objects.
Searching for Identical Objects
The final dialog boxes controls how the report searches for identical objects. If you have the same object
occurrence in a number of models then its name and attributes will appear the same in each model. Also its GUID
(Global Unique Identifier) will be same. If you create a model (for instance an “As-Is” model) and then later make
a copy of it (the “To-Be” model) and change some of the attributes of the objects in the “To-Be” model, then the
Model Comparison Report can’t tell you which attributes have been changed. This is because as soon as you
change an object attribute, it’s changed in all models where the object occurs (e.g. both the “As-Is” or “To-Be”).
If instead you make the “To-Be” model a definition or variant copy then it will have different objects even though
they initially look the same. If you then change the object attributes in the “To-Be” model, the Model Comparison
Report can now find the changes.
Of course you might change the name of the “To-Be” objects so have to tell the report how to spot the objects to
compare.
Use the GUID setting for comparing occurrence copies (you can’t do attribute comparison with this option).
Use the identical attribute option where you have definition or variant copies. You can use the name attribute if
you haven’t changed the name. If you changed the name you will need to choose some other attribute that hasn’t
changed (maybe a reference number). Now you can compare attributes and see those that are maintained or
changed.
Table output with attribute changes in definition copies:
Note: Check this post if you are looking for other free ARIS reports & macros. If you want to discuss ARIS
scripting problems, make sure to join the group Reports & Macros in ARIS.
Based on another thread I created a simple but powerful report to list unassigned models. I am pleased to share it
now with you officially!
Assuming you run it against a small database with some unassigned models in it, the result could look like this,
identifying 4 models not assigned yet.
Initially it was our idea to create it only with the reporting wizard. But because we list only unassigned models,
we have to filter in a way which seams to be not supported by the wizard yet.
In addition you get some statistical information in a second Excel sheet. This shows the number of models per
model type in your selected database and group.
How to Install
Please download right from here. You will get a zipped arx file, which needs to be installed into your ARIS
environment, section Administration > Evaluations > Reports (Please unzip it first.). Create a custom reporting
category if not yet done and load it into that.
How to start
Planned Improvements
There are already ideas how to improve the report like additional model type limitations. But this depends mainly
on your feedback.
Feedback
Please let me know any experience or particular feedback. I would be pleased to guide you in case you need
assistance.
put all data into one single sheet and will use the x-axis for the attributes and the y-axis to hold my objects itself.
The speciality here is to collect all axis values in advance and make the attributes unique. By using these
techniques you can create a nice matrix.
It is probably not a good idea to compare Events with Functions, but as defined you can run it like that.
• Matrix Report with Attributes in the row and Objects in the columns
• Dynamic and Unique List of Attributes
• Dynamic List of Objects
• Model Name only when changed
• Colored changes
As you can see there are mainly the same constants as in the other report. Only the last is new; allowing me a
faster testing (in case I set ShowDialog to false).
Step 2: Start the Main
This step doesn‘t show anything new. Just again good old friends like getFixedFileName, writeHeaderAndFooter,
defineStyles and if (sEnv == "STD").
Same to here, this procedure allows you to select a model, multiple object occurrences or object definitions when
starting.
Step 4: Table Title and First Collection (Y-Axis)
Now the difference starts: We print immediately the title and collect in array #1 all object definitions from the
occurrences.
Here we read all objects with attributes and put all of them into a new array. As this array becomes our x-axis we
make them unique.
Step 6: Print the Header
In this step the three header lines will be printed. For the model name we use the technique to hide any further
repeating value.
This step is quite simple, where as the code seams to be complicated. First we print the Attribute Name itself,
followed by all attribute values. If the value is different to the previous value, we use the red colour. In case it is
the same, it comes with black. Any first value in a row will be printed as black anyway.
Step 8: Hide the Dialog
Right after the function header there is an added command to validate the bShowDialog global variable.
Now you should get the layout as shown in the first picture. Try it out and play a bit with different selected
objects. Concerning the output format I am supporting Excel and Html only (in case you have selected many
objects the output looks much better in Excel than in html).
Summary
The described procedure allows you to create matrix reports to validate attributes across multiple objects.
I have obtained but I merged 4 Aris Standart reports and made many manuplations (matrix report, object list
report....).
Thanks
?
var oCxnOccs = oModel.CxnOccList(); //for example all
1
connections in a model
Then you iterate over the array of connections to find out what is the source and the target of every connection:
?
1 for(var j=0; j<oCxnOccs.length;j++){
2 var oCxnOcc = oCxnOccs[j];
3 var oSourceObjOcc = oCxnOcc.SourceObjOcc();
4 var sourcetype = oSourceObjOcc.ObjDef().Type(); //
5 get type of source object
6 var nSource =
7 oSourceObjOcc.ObjDef().Name(nLocale); // get name of source
8
object
9
var nCxn = oCxnOcc.Cxn().Name(nLocale); // get name
1
0 of connection
var oTargetObjOcc = oCxnOcc.TargetObjOcc();
var targettype = oTargetObjOcc.ObjDef().Type(); //
get type of target object
var nTarget =
oTargetObjOcc.ObjDef().Name(nLocale); // get type of target
object
}
Now that you have all the required information you just need the output of it =).
For example:
?
1 var oOutputFile = Context.createOutputObject(); //
2 Output object
3 var nLocale = Context.getSelectedLanguage(); // Selected
4 database language
5
6 var aModels = ArisData.getSelectedModels(); // Array of
7 selected models
8
for (var i = 0; i < aModels.length; i++) {
9
1
var oModel = aModels[i]; // Current
0 model
1 var sModelName = oModel.Name(nLocale); // Name of
1 current model
1 var oCxnOccs = oModel.CxnOccList(); //for example all
2 connections in a model
1
3 oOutputFile.BeginTable(100, Constants.C_BLACK,
1 Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
4 //table header
1 oOutputFile.TableRow();
5 oOutputFile.TableCell("ModelName", 20, "Arial", 10,
1 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
6
Constants.FMT_BOLD | Constants.FMT_CENTER |
1
7
Constants.FMT_VTOP, 0);
1 oOutputFile.TableCell("SourceType", 20, "Arial", 10,
8 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
1 Constants.FMT_BOLD | Constants.FMT_CENTER |
9 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("SourceName", 20, "Arial", 10,
0 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
2 Constants.FMT_BOLD | Constants.FMT_CENTER |
1 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("ConnectionName", 20, "Arial", 10,
2 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
2 Constants.FMT_BOLD | Constants.FMT_CENTER |
3 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("TargetType", 20, "Arial", 10,
4 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
2 Constants.FMT_BOLD | Constants.FMT_CENTER |
5 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("TargetName", 20, "Arial", 10,
6 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
2
Constants.FMT_BOLD | Constants.FMT_CENTER |
7
Constants.FMT_VTOP, 0);
2
8
2 for(var j=0; j<oCxnOccs.length;j++){
9 var oCxnOcc = oCxnOccs[j];
3
0 oOutputFile.TableRow();
3 oOutputFile.TableCell(sModelName, 20,
1 getString("TEXT_1"), 10, Constants.C_BLACK,
3 Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD |
2 Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
3
3 var oSourceObjOcc = oCxnOcc.SourceObjOcc();
3 var sourcetype = oSourceObjOcc.ObjDef().Type();
4
var nSource = oSourceObjOcc.ObjDef().Name(nLocale);
3
5 oOutputFile.TableCell(sourcetype, 20, "Arial", 10,
3 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
6 Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP,
3 0);
7 oOutputFile.TableCell(nSource, 20, "Arial", 10,
3 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
8 Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP,
3 0);
9
4 var nCxn = oCxnOcc.Cxn().Name(nLocale);
0 oOutputFile.TableCell(nCxn, 20, "Arial", 10,
4 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
1 Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP,
4
0);
2
4
3 var oTargetObjOcc = oCxnOcc.TargetObjOcc();
var targettype = oTargetObjOcc.ObjDef().Type();
var nTarget = oTargetObjOcc.ObjDef().Name(nLocale);
oOutputFile.TableCell(nTarget, 20, "Arial", 10,
Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP,
0);
oOutputFile.TableCell(targettype, 20, "Arial", 10,
Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP,
0);
}
}
oOutputFile.EndTable("", 100, "Arial", 10,
Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutputFile.WriteReport();
I hope this helps you, I have not tested it very extensively, but it should work:)..
Regards
Eva
• reply
Hi Selim,
If I understood true you want to obtaine report for group models not just one model.
Try to select the models via "explorer module" (you can't run group attributes with designer module) and push F8
button. With this way you can get a table for selection model attributes.
?
1 var aGroups = ArisData.getSelectedGroups();
Then you iterate over the array of selected groups to find out which models are in the group:
?
1 var oOutputFile = Context.createOutputObject(); //
2 Output object
3 var nLocale = Context.getSelectedLanguage(); // Selected
4 database language
5 var aGroups = ArisData.getSelectedGroups();
6
7 for (var l=0;l<aGroups.length;l++){
8
9
var aModels = aGroups[l].ModelList(); // Array of
1 selected models
0 for (var i = 0; i < aModels.length; i++) {
1 oOutputFile.BeginTable(100, Constants.C_BLACK,
1 Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
1
2 var oModel = aModels[i]; //
1 Current model
3
var sModelName = oModel.Name(nLocale); // Name
1
4
of current model
1 var oCxnOccs = oModel.CxnOccList(); //for example
5 all connections in a model
1
6
1 //table header
7 oOutputFile.TableRow();
1 oOutputFile.TableCell("ModelName", 20, "Arial", 10,
8 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
1 Constants.FMT_BOLD | Constants.FMT_CENTER |
9 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("SourceType", 20, "Arial", 10,
0 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
2
Constants.FMT_BOLD | Constants.FMT_CENTER |
1
2 Constants.FMT_VTOP, 0);
2 oOutputFile.TableCell("SourceName", 20, "Arial", 10,
2 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
3 Constants.FMT_BOLD | Constants.FMT_CENTER |
2 Constants.FMT_VTOP, 0);
4 oOutputFile.TableCell("ConnectionName", 20, "Arial",
2 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
5 Constants.FMT_BOLD | Constants.FMT_CENTER |
2 Constants.FMT_VTOP, 0);
6 oOutputFile.TableCell("TargetType", 20, "Arial", 10,
2 Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
7 Constants.FMT_BOLD | Constants.FMT_CENTER |
2 Constants.FMT_VTOP, 0);
8
oOutputFile.TableCell("TargetName", 20, "Arial", 10,
2
Constants.C_BLACK, Constants.C_TRANSPARENT, 0,
9
3 Constants.FMT_BOLD | Constants.FMT_CENTER |
0 Constants.FMT_VTOP, 0);
3
1 for(var j=0; j<oCxnOccs.length;j++){
3 var oCxnOcc = oCxnOccs[j];
2
3 oOutputFile.TableRow();
3 oOutputFile.TableCell(sModelName, 20,
getString("TEXT_1"), 10, Constants.C_BLACK,
Constants.C_TRANSPARENT, 0, Constants.FMT_BOLD |
Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
oOutputFile.WriteReport();