String workflowInstanceId, String templateName) throws RegistryException {
if (!isExperimentExists(experimentId, true)){
throw new ExperimentDoesNotExistsException(experimentId);
}
if (isWorkflowInstanceExists(workflowInstanceId)){
throw new WorkflowInstanceAlreadyExistsException(workflowInstanceId);
}
ExperimentResource experiment = jpa.getWorker().getExperiment(experimentId);
ExperimentDataResource data = experiment.getData();
WorkflowDataResource workflowInstanceResource = data.createWorkflowInstanceResource(workflowInstanceId);
workflowInstanceResource.setTemplateName(templateName);