}
public String deployProcessDefinition(String processName, InputStream definitionStream, InputStream processMapImageStream) {
RepositoryService service = getProcessEngine(ProcessToolContext.Util.getThreadProcessToolContext())
.getRepositoryService();
NewDeployment deployment = service.createDeployment();
deployment.addResourceFromInputStream(processName + ".jpdl.xml", definitionStream);
if (processMapImageStream != null)
deployment.addResourceFromInputStream(processName + ".png", processMapImageStream);
return deployment.deploy();
}