ARIS Community - We Love BPM

Aris Scripting Tutorial - Part 5 - Object Attributes - All Output Formats and Multilanguage

Volker Eckardt's picture
by Volker Eckardt in Reports & Macros posted on 2010-05-10

Hello Community,

It is time for the next tutorial. This time we will enhance again our report a bit, but also I am going to introduce the Multilanguage capability.

The main new features to be discussed are:

  • Full output format support, including PDF, Word, RTF
  • Multilanguage support via String Tables

Let's begin with the first.

Full output format support, including PDF, Word, RTF

Our previous result (see Part 4) has already covered PDF a bit, but if you run it, the output will show a preconfigured  error message. There aren't many steps to enable the report for the additional formats:

1. Remove the warning from code lines 77 to 80.

2. Enhance the code to print a title also in PDF

It seams to me that only the PDF generator cannot work with merged cells. Therefore we keep a condition for them, but in all other cases we leave the current output.

3. Remove further PDF conditions

There are some more conditions in the code to handle specific PDF output. To enable all code pieces please remove these conditions on line 150 and 155 completely, but for sure keep the EndTable and BeginTable statements below.

Now, switch on the additional output formats like Word and RTF. In all cases the printout should work and create an accurate layout.

 

Multilanguage Support via String Tables

Note: This section belongs also to reports created with the Wizard!

The way how the JavaScript environment handles multilanguage is quite elegant and easy to work with. The general approach is to remove existing hard coded text elements from the code and use a function instead. This function will read dynamically from a so called "String Table". Such a string table holds always data pairs, a text identifier and the text value itself. If requested, you can also have multiple language tables.

To show the string table, activate the check box in the upper rigth window area:

In case you work with German, Portuguese and English, your table might look like this:

 

General Procedure when working with String Tables

If you start with a new JavaScript based custom report, the string table will be empty, and only one language will be displayed.

 

To add elements, please perform the following steps:

1. Highlight a text in your JavaScript which you like to move into the string table.

2. Right mouse click, then choose "Selected text into string table ..."

This step will move the text into your string table, but also replace automatically the text in your Java Code by a function getString.

 

3. Update the Identifier

Usually you do not keep the given identifier; you make it a little bit more specific. Keep in mind that the Wizard creates identifiers like ID_DEFAULT_FONT, ID_REPORTDEFx and ID_STYLE_RD_xxxx. It is also suggested to use a kind of a prefix, followed by a more content specific word plus another to identify the details.

In my case I am going to name the first ID_META_DATABASE_NAME.

If I do so, the name in the JavaScript will be replaced automatically:

 

4. Move all textual Elements

Using this procedure, I am moving all textual elements out of my code into the string table.

There is one more feature I like to address. If you have the string "Database" twice in your code, the replacement will be done for both places automatically. This might be correct, but does not have to. Please review your code afterwards to make sure that all string table references are from logical and textual perspectives correct.

5. And also the Font Name

One more entry I like to add, it is the font name. Here I am using for the identifier the same as the wizard default (ID_DEFAULT_FONT). In this case it is really nice that the auto replacement will change the word "Arial" in all places on the fly:

The final string table will then look like this:

 

Enhancing a string table for Multilanguage

This step is quite strait forward, allows you to add more languages to the string table. Here are the steps:

1. Enable the string table

2. Right click in the header

3. Choose "Add language (copy text)" (my preference).

4. Select a language to add

This way you receive another tab for this language. Click on the additional tab and change the entries accordingly.

Hint: Use the key F2 to start editing an entry; by using a double click sometimes I am loosing my previous word.

Note: I would not translate the style formats, although these elements are also text. But as this text will not be presented to someone, there is no need for translation.

Test

Please run a test and validate that your translations are correct. Sometimes your translated word or phrase is a little bit longer compared to the original, in this case you might tailor your layout a bit.

Download

Please download the report file from here

Summary

Our report is now much more complete; we are supporting all common formats and are also able to  create  the layout in Multilanguage. Concerning the layout, a header and footer is still missing, we are going to cover this soon by introducing shared code management.

Next Article

In the next article we will further enhance the code by adding a custom dialog.

Related Articles

- Aris Scripting Tutorial - Part 4 - Object Attributes in HTML and Excel
- Aris Scripting Tutorials - Overview

Best Regards

Volker

26377 Views
0 Likes
6 Comments
Pierre Pilven posted on 2010-07-09

Hi Volker,

As usuall your post is helpfull.

I have experimented multilangual script (french/english) with chain table as you explain on your post.

When I launch the script in french no problem everything is fine, when I launch it in english my document contains ARIS Attributs in english but my chains are in french instead of english in the output document.

Is there any pre requisit ?

I did my script with the editor at the begining, then i did some changes in code, afterwards i added english in my chain table and I've translated every french chain in english. Just like you explained on your tutorial.

Then i had the problem described earlier when i've lauched the script in english.

I had a look at the function getString() to see if it was necessary to add the parameter nLocale but it seems that getString take only one parameter...

Do you have any idea on what happened ? If you want and if you have time to have a look at my problem, I can send you my script by mail.

My mail is : pierre.pilven@4sh.fr

Regards,

Pierre

Juan Arce posted on 2010-10-21

Hi Volker

I'm a new ARIS user and I'm trying to create a report that summarizes a process diagram, considering that i have no programmig knowledge i noticed the Process Manual report and i think is a good starting point but I need to add additional information of the model (such as documents, relationships, etc) to the report but I'm only able to include "Attribute Values". In summary what I need to do is:

1. Incorporate model information different that "Attributes values" such as documents, relationships, etc

2. Sort the table by how the process flows, I haven't figured out how is currently sorted.

Thank you in advance for your support

Regards

Juan

Pierre Pilven posted on 2010-11-22

Hey Juan,

To do what you describe, you'll need to use code, it seems difficult to reach your needs with ARIS Script Editor.

So you should read ARIS Script API to learn more about functions that allow you to navigate on ARIS database objects and relationship.

If you are spanish I can help you, cause it's easyer for me to speak spanish than english.

We could have a conf call on skype if you want me to describe ARIS API help you for your first script.

my skype account is : pedro__17 (with two under scores)

Regards,

Pierre

Sebouh Havatian posted on 2010-12-27

Hi greate article.

 

But I am encountering one problem. When I am running the report in a german language instead of the english, the getString function is giving me the values found in the english string table rather then the values of the german language. Knowing that I have entered diff. values in the string table for German.

 

Any advise why this is happening?

 

thanks

Pierre Pilven posted on 2010-12-27

Hey Sebouh

Yes I've solved the problem.

You need an ARIS multi langage licence.

 

Look at your licence key, you should find something like that : V71LenLfrPbitMau Len : for English language Lfr : for French language

 

So when you launch the script and select a language every attributs and constants will appear on the selected language.

 

So in my case the multi language licence key solve my problem.

You should contact your ARIS account manager if your licence is not multi language.

 

Hope it will be helpful.

Regards,

Pierre PILVEN

Romeo Paone posted on 2013-10-13

Dear All,

i hope this is the right page where i can post my question regarding the following issue.

I am trying to find the correct format to export the time attributes (static, orientation and processing time) from an excel file into my model in Aris.

The upload of the excel file worked for updating the values of  COST and FREQUENCY attributes.

For example,  a value of the time attirbute has the following format (0000:01:15:00) Constant, but adding the same format with different values on excel, it did not upload the change.

I have tried different format, but nothing seemed to work.

If anyone has a solution on this issue, it would be highly appreciated.

Thank you

Best Regards

Romeo