private OdeRuntime buildRuntime(int modelVersion) {
// Relying on package naming conventions to find our runtime
String qualifiedName = "org.apache.ode.bpel.rtrep.v" + modelVersion + ".RuntimeImpl";
try {
OdeRuntime runtime = (OdeRuntime) Class.forName(qualifiedName).newInstance();
runtime.setExtensionRegistry(_contexts.extensionRegistry);
return runtime;
} catch (Exception e) {
throw new RuntimeException("Couldn't instantiate ODE runtime version " + modelVersion +
", either your process definition version is outdated or we have a bug.");
}