Although my question is very simple I can't find an answer for it.
I created a class in Rhapsody and associated a statechart to this class but when I generate the code I can't find and code in the class related to the state chart.
Is there any function that needs to be created as a trigger or am I missing something?

After searching for a long while I could find the option that was preventing the generation.
First of all, you need to define a reactive class to be able to generate a code for a state machine. This point was OK for me and I thought this was only what matters until I found this property here: