Add Elements into a subprocess

Hello,

I want to create an embedded Subprocess with java. I can already create a Subprocess with the SubProcess.class:

My question is how to add Elements (StartEvent,Taks1,EndEvent) into the Subprocess like:

Does any example exists like the instructions (Create a Model) ? Or is this not possible and I have to use a Call Activity ?

Thanks in advance.

Hello @Dennis_T,

You can check this test for example.
Also I notice that you are talking about end event but on the picture (I don’t know which tool you’re using) it looks like intermediate event.

Best regards,
Yana