Get bpmn:Process object

Hi,
I am internally using bpmn.js in my application for all core drawing.
I have a requirement in which I need to get the process details without clicking the canvas. ie if we get the process object as soon as the diagram is loaded.

Please suggest a way to get all the process.

Thanks in Advance

You may access the loaded bpmn:Definitions and continue from there:

const definitions = bpmnJS.getDefinitions();

definitions.rootElements; 
// [ { $type: 'bpmn:Message' }, { $type: 'bpmnProcess' } ]