public void buildProcess(final Process process, Resource resource) {
if ( resource != null && ((InternalResource)resource).hasURL() ) {
((org.jbpm.process.core.Process) process).setResource( resource );
}
boolean hasErrors = false;
ProcessValidator validator = processValidators.get(((Process)process).getType());
if (validator == null) {
System.out.println("Could not find validator for process " + ((Process)process).getType() + ".");
System.out.println("Continuing without validation of the process " + process.getName() + "[" + process.getId() + "]");
} else {
ProcessValidationError[] errors = validator.validateProcess( (WorkflowProcess) process );
if ( errors.length != 0 ) {
hasErrors = true;
for ( int i = 0; i < errors.length; i++ ) {
this.errors.add( new ParserError( errors[i].toString(),
-1,