public void addExperiment(String projectName, AiravataExperiment experiment) throws RegistryException {
if (projectsRegistry != null){
projectsRegistry.addExperiment(projectName, experiment);
}else {
WorkspaceProject workspaceProject = getWorkspaceProject(projectName);
ProjectResource project = jpa.getWorker().getProject(createProjName(workspaceProject.getProjectName()));
String experimentId = experiment.getExperimentId();
if (isExperimentExists(experimentId)){
throw new ExperimentDoesNotExistsException(experimentId);
}
ExperimentResource experimentResource = project.createExperiment(experimentId);
if (experiment.getSubmittedDate()!=null) {
experimentResource.setSubmittedDate(new Timestamp(experiment.getSubmittedDate().getTime()));
}
experimentResource.save();
}