bpmn-js-examples
bpmn-js-examples copied to clipboard
Add example for custom modules
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.
This should give an introduction into module overrides, too. Cf. forum thread.