public void removeProcessDefinition(String processDefinition) throws RemoteException{
log("removeProcessDefinition", new Object[]{processDefinition});
try{
//Check there is referencing instance
ProcessInstanceRepositoryHomeLocal pihr = GlobalContext.createProcessInstanceRepositoryHomeLocal();
//if there is any of instance of this folder, this definition can't be removed
Collection pis = pihr.findByDefinition(new Long(processDefinition));
if(pis.iterator().hasNext())
throw new UEngineException("This definition has instances");
ProcessDefinitionFactory.getInstance(getTransactionContext()).removeDefinition(processDefinition);
}catch(Exception e){