I hope the following code helps you:
ProcessEngineConfiguration processEngineConfiguration = StandaloneInMemProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
ClassLoader classLoaderBefore = processEngineConfiguration.getClassLoader();
try {
processEngineConfiguration.setClassLoader(Thread.currentThread().getContextClassLoader());
} finally {
}
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
Deployment deploy = null;
try {
deploy = repositoryService.createDeployment()
.addInputStream("THE_BPMN_FILE.bpmn20.xml", new FileInputStream(new File ("C:\\THE_BPMN_FILE.bpmn20.xml")))
.deploy();
String procId = runtimeService.startProcessInstanceByKey("THE_PROCESSID_IN_XML_FILE").getId();
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e2) {
e2.printStackTrace();
}