Hi shatrusudan sharma ,
Jonathan had said it all but it seems that you are still confused.
I think you need to review and appreciate the concept of BPM (Business Process Modelling) before jumping to its technical aspect. Activiti is a piece of software that was built to help organizations achieve their BPM initiatives. And by definition, BPM is (Business process management - Wikipedia )
improvement and management of a firm's end-to-end enterprise business processes in order to achieve three outcomes crucial to a performance-based, customer-driven firm: 1) clarity on strategic direction, 2) alignment of the firm's resources, and 3) increased discipline in daily operations.
Therefore, your processes should be well thought-of and designed from end-to-end to meet the business goals. This is why Activiti provides the activiti-modeler to help people model their processes before they can be implemented.
Now for your use case, from your description,
my business requirement is we are creating One Incident through workflow. in that incident flow we will create some activity like set of task for that we will create a sub process. but in some incident have 2 activity(sub-process) or some incident have 5 activity(sub-process), and in edit case also we can add more activity(sub-process) in that same incident.
This use case is not possible for any BPM platform out there. You need to understand all possibilities of your Incident Workflow. If there's a reason that it can't be done, can you elaborate that more?
Now for your question
can we add user task or service task dynamically in started process instance. or any alternative ways to achieve this functionality.
No, you need to define user task, service task in your process definition xml.
Hope I make it clear,