Toggle Collapse Element

Hello
I’m trying to make bpmn shape toggle between collapsing and expanding by click on the shape. I’ve read in some forum I can use [modeling.toggleCollapse(myAwesomeShape);]
But there is no clear instruction?
Can Someone help me on this?
Thanks

You can use this sandbox as a guidance.

const elementRegistry = modeler.get('elementRegistry');
const modeling = modeler.get('modeling');

const subProcess = elementRegistry.get('SubProcess_1');

modeling.toggleCollapse(subProcess);