You can declare events for your application by adding one or more Event Declaration builder calls to your model.
You can also create a model that contains all the event declaration builder calls used in an application or by a set of related models and import that model into the other models. This approach saves you from adding event declarations to the target models.
- Create an empty model.
- Add an Event Declaration builder call for each event you want to be able to process.
- In the builder picker, under Builder, double-click Event Declaration.
- In the builder call editor, specify in the Event Name input a name for the event.
- If you want to send data as part of processing the event, set the argument names and types.
- Click OK to save the inputs and close the builder call editor.
Whether you decide to add event declaration builder calls directly to the models firing and handling those events or implement the repository approach, adding the Event Declaration builder calls themselves is the same.
- Save the model.
- Import the model that defines the event declarations into each model that you want to be able to fire or process one of the declared events.
Parent topic: Handling events