public void deleteProcessDefinition(String name) {
JbpmContext jbpmContext = JbpmConfiguration.getInstance()
.createJbpmContext();
try {
List<ProcessDefinition> versionList = jbpmContext.getGraphSession()
.findAllProcessDefinitionVersions(name);
for (int i = 0; i < versionList.size(); i++) {
jbpmContext.getGraphSession().deleteProcessDefinition(
versionList.get(i));
}
} finally {
jbpmContext.close();
}
}