On Order entity we have a custom field, this field on change we trigger a plugin. Create an action, it is blank action with no arguments or steps. Activate that action and use that action name while registering step in plugin.
Write the plugin code and register the plugin. In this scenario, we just have to write throw exception in code.
Register New Step
In step creation, we select message as action name (i.e., mtc_sendemaila49b5f8ca894e811) and we select primary entity as order and event pipeline stage as post-operation. Click on Register New Step.
We call above code (callAction function) during on change event in order entity. The below screenshot shows exception message in plugin.
Still need any help? Write to us at firstname.lastname@example.org. We will help you.