BPM: Use of API to Create Process model

Is there any programmatic way to create Process Model?

First, the model and the process definition are two separate things. The model represents the UI and is stored in JSON format. When you deploy the model, it’s converted to the XML that describes the process in BPMN 2.0 notation. This XML is executed by activity. So, if you want to create models or process definitions programmatically, I think, you need to generate JSON or XML files and deploy them. The code that uploads and deploys the model JSON is in the com.haulmont.bpm.gui.procmodel.ProcModelBrowse file. The code that creates a ProcDefinition from XML is in the com.haulmont.bpm.core.ProcessRepositoryManager.

Thanks, I was wrong, thought it will be in Java!!