Dear Julien,
In the body of a template construct, only deplared parameters are accessible as variable. In you example you have noly one parameter: DiagramName:String.
You should declare a parameter self (or with an other name) to be able to use it in the template construct body. For instance:
m:template insertPABdiagram(self:capellamodeller:SystempEngineering, DiagramName:String)}
regards,
Yvan.