Hello Amir,
Your question sounds somewhat like "What is the best way to drive my vehicle?" (what kind is your vehicle, what you are going to do with it, on what terrain you're going to travel, etc. )
Back on your question:
No one knows better than you what are your intentions. Activiti offers at least two ways of communication - RESTfull services and API calls. You could deploy it inside or outside your application, in the same or a different database engine and user, … There are plenty of options and "the best way" to use them depends on your approach.
The team here will be happy to help you to solve a concrete problem or to answer your concrete question. Unfortunately your question is too broad to be answered in a couple of sentences.