Automatic switch to decisiontable on load

I’m new in working with bpmn.io - a really great thing!
I still have a modeler now with the DRD an one decisiontable.
Works without problems and I’m also able to write back my changes in the XML.

When I load the page, the DRD is shown. Now I want to switch automatically to the decisiontable (there is only one table) - but I don’t get it working.

var dmnModeler = new DmnJS({
        container: '#box_saetze_content'
    });

function openDiagram(dmnXML)
    {
        dmnModeler.importXML(dmnXML, function(err)
        {
            if (err)
            {
                return console.error('could not import DMN 1.1 diagram', err);
            }
            else
            {
                console.log('rendered');
            }

            var views = dmnModeler.getViews();

            var view = views.filter(function(view)
            {
                return view.element.id === 'stueckpraemie_ermitteln';
            });

            dmnModeler.open(view);
        });
    }

$.get(diagramUrl, openDiagram, 'text');

You’d override the default behavior for finding the view to open.

class CustomDmnEditor extends DmnEditor {
  _getInitialView(views) {
    return views[views.length - 1] || views[0];
  }
}

Thanks!!! This solution worked!!

I know. Glad you could use it.