bpmn-js-examples icon indicating copy to clipboard operation
bpmn-js-examples copied to clipboard

Add example for custom modules

Open philippfromme opened this issue 9 years ago • 1 comments
trafficstars

When I implemented an example project for bpmn-js that uses an additional module I was wondering about the array sytax which you are required to use in order to make it work. As a developer who doesn't know about the internal workings of bpmn-js it might be overwhelming having to use the array syntax for something as simple as providing a different translation function for i18n. At least this is what I experienced.

Instead of just saying

var customTranslate = require('./customTranslate);

//...

additionalModules: {
  translate: customTranslate
}

I had to write

var customTranslate = {
  translate: [ 'value', require('./customTranslate/customTranslate') ]
};

//...

additionalModules: {
  translate: customTranslate
}

and figuring out what 'value' means took me even longer. An example project that shows how to use additional modules the right way would be a great addition.

philippfromme avatar Apr 26 '16 08:04 philippfromme

This should give an introduction into module overrides, too. Cf. forum thread.

nikku avatar Jun 02 '16 06:06 nikku