Clean the mushrooms, removing the soil, rinse them and tip them in a tea towel to dry then slice them into segments.Blanch the tomatoes in boiling water, once peeled, deseeded and drained from the cooking water chop them coarsely.Slice the ham into strips. Peel and finely chop the onion.In a saucepan heat 2 tbsp of oil and a bit of the chopped onion and fry until soft without allowing it to colour.Add the mushrooms and brown for 2 minutes over a high heat; drain them and keep them aside.In the same saucepan add the rest of the onion with 2 tbsp of oil and fry until soft; add the chopped tomatoes the peas, season with salt and pepper and simmer for 15-20 minutes.Before removing the pan from the heat, add the mushrooms set aside earlier with the chopped parsley.Cook the pasta in a large saucepan with plenty of boiling salted water. Drain it al dente; mix it with half of the prepared sauce, a bit of ham strips and some grated parmesan.Arrange half of the seasoned pasta in an oven-proof dish, greased with oil, sprinkle some more of the leftover sauce, add more strips of ham and sprinkle with parmesan.Cover with the rest of the pasta repeating this process. Put the oven-proof dish in a preheated oven at 200 °C for about 10 minutes until the top is lightly au gratin. Serve nice and warm.