I tried adding this custom rules example on my angular app everything seems fine, but I’m not sure if it works or not, as I’m quite not sure what this custom rules is supposed to do exactly.
I used the exact same code (same custom rule provider) added it to my bpmn modeler:
import * as BpmnJS from 'bpmn-js/dist/bpmn-modeler.production.min.js';
//import * as customRules from './customRule';
import CustomRules from './customRuleProvider';
...
constructor(private http: HttpClient) {
//console.log(CustomRules);
this.bpmnJS = new BpmnJS({
additionalModules:[
CustomRules
]
});
}
I took a look at your sandbox, and you seem to be importing the wrong file.
The file declaring your custom rules module is customRule.js, not customRuleProvider.js
Thanks for the reply,
I tried that first but changed it, (the commented line right above it, that’s why I left it).
But I dont think it works either, I tried a lot of things but my console.log in the customRuleProvider never executes it seems no matter what I try.
Also I’m not certain what this rule example does exactly so even then, I can’t tell if it works or not.
Thank you, that solved it for me.
Another quick question if I understand correctly these rules are like event listeners and get triggered when the action happens (in this case shape.create?).
So is there a list of the ‘shape.create’ like actions to pick from?
I described the global wanted behavior in a recent topic: Some questions about some specific needs and whether bpmn-js can ensure them.
But to make it brief, I want to have a startEvent and endEvent element that are irremovable (so I’m guessing I have to add them in my initial xml and give them an attribute and use a remove or delete action similar to this example?)
I only want 1 startEvent and 1 endEvent (the ones initially generated) and wouldn’t need anymore (I think removing eventStart and eventEnd from the context pad and palette would do the trick and the user wouldn’t be able to add any)