I want to create a nifi data flow using java api. Is it possible if yes, how..?
Managing / editing flows in NiFi is done through the REST API. Full docs on it can be found here: https://nifi.apache.org/docs/nifi-docs/rest-api/index.html.
@Andrew Grande has a great tutorial on how to do this over here: https://community.hortonworks.com/articles/3160/update-nifi-flow-on-the-fly-via-api.html .
If you have any specific questions about managing the flow we can help get you on your way to programmatically managing a NiFi flow.