It in fact depends how you perform the assignment in the tool. If, you drag a Behavior onto a State symbol in a StateMachine Diagram it will give you a choice of whether you wish to use it as 'entry', 'doActivity', or 'exit', and will then wrap it automatically. The same applies when dragging onto a Transition symbol to assign an 'effect':
The tool does NOT always get the synchronisation of parameters right in the wrapper Activities it creates!
However, if you use the specification dialog, and drag an Activity from the model tree into the 'effect' field of a Transition or the 'entry', 'doActivity', or 'exit' field of a State, it will move the Activity so that it is owned by the State or Transition!