What I want to achieve is following: Imagine we already have a task and when I click it it shows me some properties. Now if I add some external button and if i click it, it should select already created task. How is it possible to do?
There are certain events and modules you can use to listen for this and apply your custom logic.
Imagine we already have a task, and when I click it shows me some properties
// listen on element click events
const eventBus = modeler.get('eventBus');
eventBus.on('element.click', function(event) {
const element = event.element;
// do whatever you want, e.g. access properties
});
Now if I add some external button and if i click it, it should select already created task.
// select an element on the canvas
const elementRegistry = modeler.get('elementRegistry');
const selection = modeler.get('selection');
const element = elementRegistry.get('someElementId');
selection.select(element);