Not able to get Javascript interactions like dropdowns and rules things happening to my dmn table


#1

Hi,
I am usng dmn-js in my angular 4 project. I am able to import the table into my UI through an API call but I am not able to view the javascript interactions like add rules and on click dropdowns, also I am not able to show my table if I am using the container as div’s id and only if I give my container as body then I am able to see the table. Can anyone help me with this.


#2

Hey, are you sure you’re using the Modeler and not the Viewer?


#3

Hey, I am implementing dmn-js directly I dont know to separately implement the modeller and viewer. This is how I am implementing my dmn:

import * as dmnJs from ‘dmn-js’;

import modeler from ‘…/…/…/…/…/…/…/node_modules/dmn-js/lib/Modeler’;

const dmn = require(“dmn-js”);

this.viewer = new dmn({container: ‘body’});
console.log(this.viewer);
this.viewer.importXML( res[’_body’],function(err){

   if (!err) {
      console.log('success!');
    } else {
      console.log('something went wrong:', err);
    }
 });

Is this the correct implementation? I am importing modeler too


#4

By default you’re importing the modeler, as you can see here.

The correct way to import the modeler (without ES2015 module syntax) is

var DmnJS = require('dmn-js/lib/Modeler');

You can see this in action in the Camunda Modeler.

Hope that helps.


#5

Thanks Philip I will try this