Internal data of a dependency matrix can be used outside the dependency matrix component. You can export the data to any required format.

Use the com.nomagic.magicdraw.dependencymatrix.configuration.MatrixDataHelper class to get the data component of a dependency matrix. You will get all row and column elements and access all cell information. You can also check, if the dependency matrix is empty.

The MatrixDataHelper class has three methods that are to be used to access data of the matrix. First of all you must check, if the matrix is already built (building the matrix means collecting all the needed data from the model). In some cases, when settings are changed or a lot of model changes occur, you have to rebuild the matrix to get the up-to-date information. Thus the best pattern to use is as follows:

    MatrixData matrixData;
    if (MatrixDataHelper.isRebuildNeeded(matrix))
    {
        matrixData = MatrixDataHelper.buildMatrix(matrix);
    }
    else
    {
        matrixData = MatrixDataHelper.getMatrixData(matrix);
    }

The duration of the build process depends on both the com.nomagic.magicdraw.dependencymatrix.datamodel.cell.DependencyExtractor implementation and the size of the matrix.