I'm following Mat Buckland's Programming Game AI by Example, and I find that I don't always have use for enter(), execute() and exit() on an entity's state. For example, in an RPG, a weapon may have an equipped state, and I may use enter() and exit() for that state to add or subtract to a player's ability modifier, but there isn't really a need for execute(). Is this a design flaw in my engine, or a shortcoming of this approach?
Not having read the book, those calls sound like normal entry points for a state machine. To understand the calls, let's look at what they do.
enter() - executed when the state is activated.
execute() - executed while the state is activated.
exit() - executed when the state is deactivated.
These fit any kind of state machine. Some machines only need the 'execute' calls, others need the 'enter' and 'exit', and still others need all the three.
Example 1: Machine gun trigger.
Example 2: Force bridge
Example 3: Personal power armor.
It's not necessarily a sign of any flaw. Not every entity or state will have a use for every available method. Just leaving the execute() method empty would be fine, IMO.