Hi Sindhurakshak,
You're welcome. I believe the problem still lies on the Event Structure at the "OTP" state. I can suggest the following (let's say everything still ends up to OTP from what I understand from your current code):
Remove the select and create an additional Event case for "end" boolean switch. Place the enum for terminate in that case as shown below:
The above modification means that if "end" boolean switch value is changed (presuming that it will change to true), the event case will run the "end" event case which will then pass the "Terminate" enum value to the shift transition. Let's say that if "end" boolean button has not changed (meaning has not been pressed), It should run the rest as shown below:
I'll leave the "OTP" enum value in Timeout, presuming that you want the state to still run the "OTP" state when idle unless you press the "end" button to trigger the "Terminate" transition.
Hope it helps
Warmest regards,
Lennard.C