Calling End Points when Scheduling
It's possible to call an end point each time a events is scheduled. Your plugin will need to be picked on the scheduling form.
In the plugin configuration, add the namespace of the end point you'd like to call:
"occurrenceCreationEP": "goss.BookAndPay.plugins.marketStallsV2.createReservations"
The example above is part of a market stalls booking application. When a market day is scheduled, the end point looks up any users who are registered as market traders, and automatically creates reservations for them (tickets and packages represent market stalls).
Parameters
The plugin is called by the workflow process that creates event instances. It is passed the following:
{
occurrenceBk: _businessKey,
data: JSON.parse(form_DATA),
eventId: parseInt(form_BOOKABLEID, 10),
packageLink: packageLink
}
| Name | Type | Description |
|---|---|---|
| occurrenceBk | String, required | The business key of the event instance |
| data | Object, required | A copy of all of the data set in the scheduling form. It's best to use the process modeller to inspect a process instance to see what this includes. The process is called "ThingInstance v1" |
| eventId | Integer, required | The ID of the event (article ID) that's being created |
| packageLink | Object, required | IDs of the packages that have been created for this instance |
