How to make undo and redo work with bpmn bower bundle?


var BpmnViewer = window.BpmnJS;

    var bpmnModeler = new BpmnViewer({
      container: '#canvas',
        parent: '#js-properties-panel'
       keyboard: { bindTo: document }

bpmnModeler.redo(function(err) {
            if(err) {


var BpmnViewer = require('bpmn-js/lib/Modeler');

var camundaModdleDescriptor = require('camunda-bpmn-moddle/resources/camunda');

var additionalModules = [

  // 1. require camunda provider instead of the bpmn one (!)

BpmnViewer.prototype._modules = BpmnViewer.prototype._modules.concat(additionalModules);

// 2. include camunda moddle descriptor
BpmnViewer.prototype._moddleExtensions = { camunda: camundaModdleDescriptor }

module.exports = BpmnViewer;

Two issues here:

  • You need to use the modeler for modeling capabilities and redo / undo functionality
  • You need to carry out redo / undo via the CommandStack:
1 Like

is it possible to provide example using my code ? When you say “you need to use the modeler for modeling capabilities” you meant i can use bpmnModeler.get('commandStack').undo(); Or i have to import some other module ? I tried below code but its not doing anything ('commandStack').redo() is coming undefined.

 $scope.redoXml = function () {
    console.log('testing redo');

I made it worked i really appreciate your help and support.Thank you for the help.

1 Like

Mind to show how you did?