I’m working on this code. but i’m having some problem. How can i handle the call to the process that i consider inside the call activity? is possible to “expand” the call activity to check the process inside? and how can i make this?
async function subProcessGeneration(id_passed, content_label, diagram_to_import) {
try {
const id = id_passed;
const elementRegistry = viewer.get('elementRegistry');
const not_exists = elementRegistry.get(id_passed) == undefined ;
if(not_exists){
const subprocess = elementFactory.createShape({
type: 'bpmn:CallActivity',
id: id,
name: content_label,
isExpanded: true,
});
subprocess.businessObject.id=id_passed;
//subprocess.di.id=id_passed;
const mainProcess = canvas_ref.getRootElement();//getMainProcess();
modeling.createShape(subprocess, { x: 700, y: 100 }, mainProcess);
subprocess.businessObject.name = content_label;
modeling.updateProperties(subprocess, { name: content_label });
return subprocess;
}
else{
return false;
}
} catch (error) {
console.error('Si è verificato un errore durante la creazione del sottoprocesso con processo interno:', error);
return null;
}
}