Hi, is there any limit on number of elements in any subprocess?
We create agi-call flow using bpmn-modeller, we can introduce several custom components in the flow such as: User input, Voice, Record Voice etc.
We can also create a subprocess which can include our custom components.
Now, for AGI calling we have used asterisk, and bpmn-engine to load the flow while agi calling.
My doubts are regarding modeller and engine:
- Whenever we create any new subprocess and expand it, it creates a start event by default, but does not adds end event (
bpmn:IntermediateThrowEvent
), why is it so? - What exactly is the role of '
bpmn:IntermediateThrowEvent
, does it throw any event or is it a simple end event?
We are using following process to create an instance of engine and implement onStart and onWait, which is executed at start of an AGI call:
bpmnEngine = Engine({
name: 'Call Listener', extensions: {
bpmnSaveServiceResultToVar, bpmnActivityHandler
}
});
const sourceContext = await getSourceContext(session, xmlData);
bpmnEngine.addSource({ sourceContext });
console.log("Loading BPMN flow");
activityListener.on("wait", BpmnActivityHandler.onWait);
bpmnEngine.on(EVENT_TYPES.BPMN.END, () => {
console.log("AGI call ended");
});
await bpmnEngine.execute({
listener: activityListener,
// activity variables
variables: {
var1: var1,
var2: var2
},
services: { ...listOfServices }
});
and function bpmnActivityHandler:
return {
activate() {
bpmnActivity.on("enter", async (elementApi, engineApi) => {
bpmnActivity.broker.publish('format', 'run.format.start', { endRoutingKey: 'run.format.complete' });
try {
const response = await BpmnActivityHandler.onStart(elementApi, engineApi);
// response (true: continue the call, false: ended the call)
// returning only in case of false response to exit the activate block.
if (!response) {
// exiting the activate block
return false;
}
} catch (err) {
console.error("Error:",err);
return CallService.endCall();
}
bpmnActivity.broker.publish('format', 'run.format.complete', { msg: "testmm" });
}, { consumerTag: 'format-on-enter' });
},
deactivate() {
bpmnActivity.broker.cancel('format-on-enter');
},
};
}
Now the issue I am facing is that I am using multiple custom components (around 40-50 components) inside a single subprocess, but after a point it does not ends the subprocess, i.e. the AGI call continues and gets stuck at the end, it should have moved to next subprocess, but it gets stuck. There is no issue in custom component, it is due to bpmn-engine, because when I remove a part of subprocess, it works fine, but I don’t want to do so.
Can someone please help me with these doubts?