public static Object instantiateDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) {
return instantiateDelegate(clazz.getName(), fieldDeclarations);
}
public static Object instantiateDelegate(String className, List<FieldDeclaration> fieldDeclarations) {
ArtifactFactory artifactFactory = Context.getProcessEngineConfiguration().getArtifactFactory();
try {
Class<?> clazz = ReflectUtil.loadClass(className);
Object object = artifactFactory.getArtifact(clazz);
applyFieldDeclaration(fieldDeclarations, object);
return object;
} catch (Exception e) {
throw new ProcessEngineException("couldn't instantiate class " + className, e);