If an Activity has been defined using an Activity diagram, then it is not possible to enter Alf code for it. If you want to re-define an existing Activity using Alf, then, first, open the Activity diagram and delete all Activity Nodes on it other than Activity Parameter Nodes. Then you can proceed to enter Alf code for it as above.