How to keep the process instance from ending automatically?

In the process instance, the last task node is not connected to the end node. When the task (the last task in the process instance) is executed, the process instance will automatically end. How can the process instance not end automatically?Maybe someone knows the relevant source code for the automatic end of the process instance?
Thank you.

Hi Kelly,

Why do you need to stop process before the end task?
(Put some wait task (receive/user task) before the process end.)


This is according to the BPMN spec. Any activity with no outgoing sequence flow is treated as if it goes to a none end event.