Package eu.planets_project.tb.api.model

Examples of eu.planets_project.tb.api.model.ExperimentExecutable


      //that's the one used when building this in 'design experiment'
      return this.expTypeWeeUtils.getWeeWorkflowConf();
        }
    if(expBean.getApproved()){
      //that's the one after 'design experiment' has been saved
      ExperimentExecutable expExecutable = expBean.getExperiment().getExperimentExecutable();
      return expExecutable.getWEEWorkflowConfig();
        }
    return null;
  }
View Full Code Here


  public TestbedServiceTemplate getServiceTemplate() {
    TestbedManager tbManager = TestbedManagerImpl.getInstance(true);
    //get the Experiment this phase belongs to
    Experiment thisExperiment = tbManager.getExperiment(this.lExperimentIDRef);
   
    ExperimentExecutable executable = thisExperiment.getExperimentExecutable();
    if(executable !=null){
      //it has already been created
      return executable.getServiceTemplate();
    }
    else{
      return null;
    }
  }
View Full Code Here

   */
  public void executeExperiment(Experiment exp){
     
     //1) Get the required data and build the request
      //ExperimentExecutable already contains the input data
      ExperimentExecutable executable = exp.getExperimentExecutable();
      if( executable == null ) {
          log.error("executeExperiment: executable is null!");
          return;
      }
     
      //DECIDE UPON WHICH BATCH_QUEUE WAS CHOSEN WHAT PROCESSOR TO CALL
      // Look for the batch system...
      TestbedBatchProcessorManager tbBatchManager = TestbedBatchProcessorManager.getInstance();
      BatchProcessor bp;
     
      //a) TB-experiment types before version1.0 - these use the ExperimentWorkflow
      if(executable.getBatchSystemIdentifier().equals(BatchProcessor.BATCH_IDENTIFIER_TESTBED_LOCAL)){
        //get the specific batchProcessor implementation
        bp = tbBatchManager.getBatchProcessor(BatchProcessor.BATCH_IDENTIFIER_TESTBED_LOCAL);
        // Invoke, depending on the experiment type:
        ExperimentWorkflow ewf = executable.getWorkflow();
        log.info("Submitting workflow: "+ewf+" to batch processor: "+BatchProcessor.BATCH_IDENTIFIER_TESTBED_LOCAL);
        log.info("Got inputs #"+executable.getInputData().size());
        String queue_key = bp.submitBatch( exp.getEntityID(), ewf , executable.getInputData());
        //already set: executable.setBatchQueueIdentifier(BatchProcessor.BATCH_QUEUE_TESTBED_LOCAL);
        executable.setBatchExecutionIdentifier(queue_key);
              executable.setExecutableInvoked(true);
              executable.setExecutionCompleted(false);
              log.info("Got key: "+queue_key);
      }
     
      //b) TB-experiment types using the wee batch processor
      if(executable.getBatchSystemIdentifier().equals(BatchProcessor.BATCH_QUEUE_TESTBED_WEE_LOCAL)){
        //get the specific batchProcessor implementation
        bp = tbBatchManager.getBatchProcessor(BatchProcessor.BATCH_QUEUE_TESTBED_WEE_LOCAL);
        log.info("Submitting workflow to batch processor: "+BatchProcessor.BATCH_QUEUE_TESTBED_WEE_LOCAL);
        log.info("Got inputs #"+executable.getInputData().size());
        //DataHandler dh = new DataHandlerImpl();
        //NOTE: previously submitting digital objects...
        //List<DigitalObject> digos = dh.convertFileRefsToURLAccessibleDigos(executable.getInputData());
        //submit the batch process to the WEE
        //String queue_key = bp.sumitBatch(exp.getEntityID(), digos, executable.getWEEWorkflowConfig());
       
        //NOTE: changed to submitting by data registry references..
        //submit the batch process to the WEE passing objects by reference (shared data registry pointers)
        List<URI> digoRefs = new ArrayList<URI>();
        for(String inputDataRef : executable.getInputData()){
          try{
            digoRefs.add(new URI(inputDataRef));
          }catch(URISyntaxException err){
            log.debug("this shouldn't happen - conversion String -> URI failed for "+inputDataRef);
          }
        }
        String queue_key = bp.sumitBatchByReference(exp.getEntityID(), digoRefs, executable.getWEEWorkflowConfig());
       
        if((queue_key!=null)&&(!queue_key.equals(""))){
          executable.setBatchExecutionIdentifier(queue_key);
          //executable.setExecutableInvoked(true);
                executable.setExecutionCompleted(false);
                log.info("Got key: "+queue_key);
        }else{
          //something on the batch processor went wrong....
          //FIXME: This is not really sufficient... inform notify_failed?
          executable.setExecutionCompleted(true);
          executable.setExecutionSuccess(false);
        }
             
      }
  }
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.api.model.ExperimentExecutable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.