Closed linonetwo closed 4 months ago
Difficult to tell from the code, and its comment is difficult to understand to me.
/**
returns Model Events (like timers) for authorized to the user and based on specifid query
*/
findEvents(query:any, user?: ISecureUser);
bpmn models can have events that need to be processed by the engine without engine.start
So if a model has a start timer event, the engine need to monitor that and start the model.
Thanks, do you mean this?
Currently if reading of BPMN file is triggered by engine.start
await api.engine.start('log-console.bpmn', { key: 'value' }, SystemUser);
// only after this, the ModelsDatastore.getSource is called to get bpmn file
I'm confused about who add the timer event, and what's timer event's interface. I will add some TS type after I make it clear.
Actually, there are few scenarios:
On saving the model, data is parsed and those events are saved into the DB.
For Timer Start Events, on bpmn-server start ,findEvents is called for timers and then processed.
For Message and Signals, when a message is called, findEvents is called for the message/signal
On saving the model
This is another question, I haven't seem this gets called. Do I need to call something to trigger this?
I find many method is not called when I only use api.engine.start
when a message is called
Am I understand correctly? When you api.engine.start
a bpmn file, it register message/signal listener on computer memory, and when I trigger the "saving the model", it save to DB. And I can stop the bpmn file safely.
Later, when computer restart, and new BPMNServer(config, config.logger)
, it get the infomation back, and auto load the related BPMN file based on processId
.
Not exactly Model save must happen first When message is fired it finds the corresponding responder; either a running workflow or a model start event; it doesn’t wait Sent from my iPhoneOn Jul 24, 2024, at 1:57 AM, lin onetwo @.***> wrote:
when a message is called
Am I understand correctly? When you api.engine.start a bpmn file, it register message/signal listener on computer memory, and when I trigger the "saving the model", it save to DB. And I can stop the bpmn file. Later, when computer restart, and new BPMNServer(config, config.logger), it get the infomation back, and auto load the related BPMN file based on processId.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I will test this and write doc.
What does its input "Timer" mean? Also what should be returned?