((SingleSessionCommandService) commandService).
addInterceptor(new ManualPersistInterceptor((SingleSessionCommandService) commandService));
try {
Class<?> clazz = Class.forName("org.jbpm.persistence.ManualPersistProcessInterceptor");
Constructor<?> c = clazz.getConstructor(SingleSessionCommandService.class);
Interceptor interceptor = (Interceptor) c.newInstance(commandService);
((SingleSessionCommandService) commandService).addInterceptor(interceptor);
} catch (ClassNotFoundException e) {
//Expected of non-jbpm based projects
} catch (Exception e) {
//something unexpected happened