Some questions about some specific needs and whether bpmn-js can ensure them

Hi @YSFSK, welcome! I’ll try to answer your questions

My diagram needs to be restricted to one startEvent and one endEvent , and it would be very convenient if they are initiated on start, fixed , and cannot be removed .

Since as I said, I wanted “directed acyclic graphs” only, I want also the added tasks to have only one input link at max and one output link at max .

You can use custom rules for this.

Remove most elements in the palette , as they wouldnt be needed, in fact I would probably only need the create task element all the other would be omitted, even the start and endEvent too (as I want them fixed - first bullet).

I’d also want to delete some of the context pad elements as I wil only need these 3 : “Append Task”, “remove”, and maybe “connect using sequence…”.

You can also customize the context pad and palette via extensions.

I also want to make a created task not editable manually , only through a form (a dialog through angular basically), so when double clicking on a task or creating a new one with the the context pad it wouldn’t allow to change the tasks name , instead it opens a form where I can select what the name of it should be (from a list I provide let’s say).

You can have a look into this thread answer. It shows how to disable the direct editing for an element via double clicking (returning false). With this event handler, it would also be possible to add your custom logic, e.g. opening a modal.

Finally, is it possible to call a function at the end and get called by a submit button for example that checks some conditions before submitting : for example

That’s in general not a concern of our toolkits. You’re free to add any UI elements on top and use our API, e.g. getting elements via elementRegistry.

How I was able to answer some of your questions. If possible, please try to follow up on different threads with one question at a time, and link to this original one. It will keep our discussions focused.

1 Like