When I use moddle.create() in the same file where I have defined definitions and moddle, then it works fine. But if I use the moddle.create in a separate service file then it gives error. I am attaching the code and error below.
Code:
Service:
static createBpmnTask(moddle,attributes){
const bpmnTask = moddle.create("bpmn:Task",attributes);
return bpmnTask;
}
Its usage:
const bpmnTask1 = BpmnService.createBpmnTask(moddle, {
id: "TaskId",
name: "Component Voice",
outgoing: [seqFlow1],
"voice:taskType": "playVoiceFile",
"voice:voiceFilePath": "/filePath",
"voice:voiceFileInfo": "Fileinfo"
});
Error: Cannot read properties of undefined (reading ‘isGeneric’)