your code is not clear. what triggers a cancel? also a state is usually:
current state -> process input -> new state
you are combining a state machine with background threads. what is the interaction? is the input process async? is the state machine a separate thread?
you keep showing a transport belt with sensors. what do the sensor report? what is the actual use of each sensor. you show a product passing sensors, can a product be a sensor start and another at sensor end at the same time?