Help build flow step messager.
npm install step-builderHelp build flow step messager.
- each step has a name prefixed with 'flow' and flow name, such as flow.$flow.$step
- for the entry step, subscribe the topic of its name
- for other steps, subscribe the topics it follows
- for all subscriptions, use its name as queue group name
- the topics a step emits are classified into 2 categories:
- $name.ok(.*)?
- $name.failed(.*)?
``
(Options) => Void
Options ~ {
natsEx: NatsEx,
flowName: String,
stepName: String,
followStep?: String,
validator?: (data) => data,
handler: Handler
}
Handler ~ (data, message, receivedTopic): HandlerThis => Promise => Void
HandlerThis ~ {
emit: {
ok: (data?) => messageId,
okCase: (case: String, data?) => messageId,
failed: (data?) => messageId,
failedCase: (case: String, data?) => messageId,
}
}
``
MIT