Can not access elementRegistry.forEach

bpmn version ;
“vue”: “2.5.2”,
“bpmn-js”: “^8.10.0”,
“bpmn-js-properties-panel”: “^0.46.0”,
“bpmn-js-transaction-boundaries”: “^0.1.1”,
“camunda-bpmn-moddle”: “^5.0.0”,

code :
const elementRegistry = this.bpmnModeler.get(‘elementRegistry’);
console.log("elementRegistry1: " ,elementRegistry);
elementRegistry.forEach(function (elem, gfx) {
console.log("forEach … ");

the problem is we can not go in forEach loop
and console.log can not work in foreach fn
can someone tell us what is wrong ?
thank you in advance

Hello @dtbdtb,

Can you give more context as to why you aren’t able to use elementRegistry.forEach? Feel free to share a CodeSandbox that demonstrates the issue.

glad to get your reply
but our code can not runin codesanbox
but can u feel free to participate with us to survey in our system ?

Let me try to understand the issue. Do you get an error while doing elementRegistry.forEach or is there something that isn’t working? Do you need to use console.log?

we resolved it
we get bpmxmlstr from db ,and then import ,and then we use code above (we put code here ,not in mouted of html step),that work now
thank you for your prompt reply