How to exclude specific actions in undo , redo chain?

Hi,

One of my requirement , I’m doing the update the shape & connector id’s when creating by using the below method.
uid is my customID
this.bpmnJS.get(‘modeling’).updateProperties(elem, { id: uid });

I want to make the above action excluded in commandStack undo , redo chain

could you please help here?

You cannot do that.

Stuff that you run via modeling will always be part of the undo / redo chain.

Give us a few more pointers your use case and we can check if there are better ways of accomplishing what you want.

Hi,
Here is my flow

let bpmnEvents = [
‘shape.added’,
‘connection.added’
];

this.bpmnjs= new bpmnjs()

when shape / connection creates I’m modifying the id of bpmn shape, sequence flow

bpmnEvents.forEach(bpmnEvent => this.getEventBus().on(bpmnEvent, this.modifyElemId));

modifyElemId = (event) => {
const elem = event.element;
let uid = this.helperUtil.createAwdUID(); // this is the custome ID as per requirement
setTimeout(() =>{
this.bpmnJS.get(‘modeling’).updateProperties(elem, { id: uid }); // //modifying the bpmnId to customID
});

}

@nikku Can you please help me on this

I got the solution . The below steps I written

1>override the bpmnfactory .–>ensureID()

here I overrided the shape and sequenceflow ids to customID

1 Like

That is the proper way to implement custom ID schemes :+1: :rocket:

1 Like