Answered

Creating a Matrix

I would like to create a Matrix, size of 5x5, in a form. More specifically I am trying to create a Risk Matrix which looks like this. So in order to do that I need to:

1) Have access to each individual cell of the matrix in order to manipulate its data. For example in some other programming language if I wanted to assign cell number [1][1] of a matrix called "Example_Matrix " the value 5, I would write "Example_Matrix [1][1]= 5;"

2) Change the color of each individual cell background. For example cell [1][1] will have a green background while cell [2][1] will have a red background.

Is it possible?

I have read about Tables but this is not exactly what I need. That is, because on tables you cannot change the background of each individual cell. Also tables represent Collations, not Arrays, meaning I cannot have access on a specific cell.

Thank you in advance!

Comments (1)

photo
1

Dear Andreas

In Bizagi, you can iterate over a collection and set the values for desired attributes of a given row. Please refer to following for details:

http://help.bizagi.com/bpm-suite/en/index.html?iterate_over_xpath.htm

In some cases it is necessary to handle Collections in expressions without using the Iterate over Xpath functionality to allow a complete manipulation of the code. This can be done using the advanced function GetValueAsCollection.

You can also write a script as below (as an example):

var Collection1 = CHelper.GetValueAsCollection(<ProcessEntity.Collection1>);

for (var j=0; j< Collection1.size(); j++){

}

Then, in the for loop you can use getXPath() and setXPath() as below:

Collection1.get(j).setXPath();

Collection1.get(j).getXPath();

To change the background color of cells, please refer to following help:

http://help.bizagi.com/bpm-suite/en/index.html?performing_actions_on_collecti.htm

Hope this helps!

Best Regards