Sometimes we might get the chance to use only one Plugin on different and it would have separate business logic to perform on different stages.
Here is the table which shows the associated stage number with the stage name and the event.
|Event||Stage Name||Stage Number||Description|
|Pre-validation||10||Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage may execute outside the database transaction.|
|Pre-Event||Pre-operation||20||Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage are executed within the database transaction.|
|Post-Event||Post-operation||40||Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins registered in this stage are executed within the database transaction.|
We can use this numbers as conditions in the plugin as shown below.
You might be thinking why 30 is missing in the middle. We do have 30 but it is for main operation which we cannot use in the custom plugins.
|Platform Core Operation||Main Operation||30||In-transaction main operation of the system, such as create, update, delete, and so on. No custom plug-ins can be registered in this stage. For internal use only.|
Hope this helps.