Package eu.planets_project.ifr.core.wee.api.workflow.generated

Examples of eu.planets_project.ifr.core.wee.api.workflow.generated.WorkflowConf


      String workflowTemplateName, String xmlWorkflowConfig)
      throws Exception {
   
    wfConfUtil.checkValidXMLConfig(xmlWorkflowConfig);
    //read the xml config data and create java representation of it
    WorkflowConf wfConf = WorkflowConfigUtil.unmarshalWorkflowConfig(xmlWorkflowConfig);
    //use workflowFactory to create a new WorkflowInstance with the provided data
    WorkflowInstance wfInstance = WorkflowFactory.create(wfConf, digObjs);
    log.debug("created workflow instance ID: "+wfInstance.getWorkflowID() +" for template "+wfConf.getTemplate().getClazz());
    //submit the wfInstance for execution
    UUID ticket = weeManager.submitWorkflow(wfInstance);
    log.debug("submitted workflow instance ID: "+wfInstance.getWorkflowID() +" position in queue: "+weeManager.getPositionInQueue(ticket));
    //hand back the ticket
    return ticket;
View Full Code Here


     * @see buildWorkflowConfFromCurrentConfiguration
     * @return
     * @throws Exception
     */
    public String buildXMLConfig(Template serTempl, Services services) throws Exception{
      WorkflowConf conf = new WorkflowConf();
     
      conf.setServices(services);
      conf.setTemplate(serTempl);

    try {
      return wfConfigUtil.marshalWorkflowConfigToXMLTemplate(conf);
    } catch (Exception e) {
      log.debug("Unable to build the XMLWorkflowConfiguration",e);
View Full Code Here

    ExperimentBean expBean = (ExperimentBean)JSFUtil.getManagedObject("ExperimentBean");
    if(expBean.getExperiment()==null){
      //this is the case when the 'new experiment' hasn't been persisted
      return;
    }
    WorkflowConf storedConf = expBean.getExperiment().getExperimentExecutable().getWEEWorkflowConfig();
 
    //2) possibly populate bean from stored information
    if(storedConf!=null){ 
      this.setWeeXMLConfig(storedConf);
      //and call the populate from wfConfig method
          populateServiceInformationFromWorkflowConfig();
          this.setXMLConfigFileProvided(true);
          //fill additional required gui information
          this.setWeeXMLConfigFileRef("empty");
          this.setXMLConfigFileProvided(true);
          this.setXMLConfigValid(true);
         
          //check if the template is still available on the wee system
          WftRegistryService wftRegistryService = WeeRemoteUtil.getInstance().getWeeRegistryService();
      if (wftRegistryService.getAllSupportedQNames().contains(storedConf.getTemplate().getClazz())){
        this.setTemplateAvailableInWftRegistry(true);
      }else{
        this.setTemplateAvailableInWftRegistry(false);
      }
    }
View Full Code Here

      try {
        String xmlConfigContent = helperReadDigoToString(fileRef);
          //check validity against schema
          wfConfigUtil.checkValidXMLConfig(xmlConfigContent);
          //unmarshall the object with JAXB
          WorkflowConf config = WorkflowConfigUtil.unmarshalWorkflowConfig(xmlConfigContent);
         
          //fill the with information
          this.setWeeXMLConfigFileRef(fileRef);
          this.setXMLConfigFileProvided(true);
          this.setWeeXMLConfig(config);
          this.setXMLConfigValid(true);
          log.debug("Workflow XML config file valid and properly parsed - configuration written to bean for workflow: "+config.getTemplate().getClazz());
   
    } catch (DigitalObjectNotFoundException e) {
      this.setXMLConfigFileProvided(false);
      throw e;
    } catch (URISyntaxException e) {
View Full Code Here

     * instead of the WorkflowConf object. This may be offered for downloading.
     * @see buildWorkflowConfFromCurrentConfiguration
     * @return
     */
    public String buildXMLConfigFromCurrentConfiguration(){
      WorkflowConf conf = new WorkflowConf();
     
      //1.add the template retrieved from the uploaded wfconfig
      Template serTempl = this.getWeeXMLConfig().getTemplate();
     
      Services services = new Services();
      //2.browse through the servicebeans and build the Services object
      for(ServiceBean sb : this.getServiceBeans()){
        Service service = new Service();
        service.setId(sb.getServiceId());
        service.setEndpoint(sb.getServiceEndpoint());
       
        Parameters parameters = new Parameters();
        //3. iterate over all parameters that have been created/altered
        for(ServiceParameter param : sb.getServiceParameters()){
          Param parameter = new Param();
          parameter.setName(param.getName());
          parameter.setValue(param.getValue());
          parameters.getParam().add(parameter);
        }
        if(parameters.getParam().size()>0){
          //there needs to be a Parameter element only if there's a param for being xsd compliant
          service.setParameters(parameters);
        }
       
        services.getService().add(service);
      }
     
      conf.setServices(services);
      conf.setTemplate(serTempl);
     
      try {
      return wfConfigUtil.marshalWorkflowConfigToXMLTemplate(conf);
    } catch (Exception e) {
      log.debug("Unable to retrieve the XMLWorkflowConfiguration",e);
View Full Code Here

    /**
     * Extracts Service Endpoint and Parameter information from a given xml configuration
     * and queries the service registry to retrieve Service type, etc. and checks if it's registered
     */
    public void populateServiceInformationFromWorkflowConfig(){
      WorkflowConf wfConfig = this.getWeeXMLConfig();
      Services services = wfConfig.getServices();
      if(services==null)
        return;
      List<Service> lServices = services.getService();
      //now iterate over all declared services from the config
      for(Service service : lServices){
View Full Code Here

    }
   
    private void initWorkflowParams(){
      //worfklow parameters are modified by this bean and therefore aren't directly loaded from the exp bean
      //every time. the init fetches parameters from the WorkflowConf object where they are stored
      WorkflowConf wfConf = this.getWeeWorkflowConf();
      if((wfConf!=null)&&(wfConf.getServices()!=null)){
        this.serviceParams = new HashMap<String,Parameters>();
        for(Service service : wfConf.getServices().getService()){
          //add the params for this endpoint
          this.serviceParams.put(service.getEndpoint(), service.getParameters());
        }
      }
    }
View Full Code Here

    }else{
      sMigrate.setParameters(new Parameters());
    }
      services.getService().add(sMigrate);
     
      WorkflowConf wfConf = null;
      try {
      if((this.getMigrationService()!=null)&&(this.getInputFormat()!=null)&&(this.getOutputFormat()!=null)){
        //build the WorkflowConf object from the bean's content
        wfConf = this.expTypeWeeUtils.buildWorkflowConf(serTempl, services);
      }
View Full Code Here

      JAXBContext context;
      try {
        context = JAXBContext.newInstance(WorkflowConf.class);
        Unmarshaller um = context.createUnmarshaller();
        WorkflowConf wfc = (WorkflowConf) um.unmarshal(new StringReader(xmlWFConfig));
        return wfc;
      } catch (JAXBException e) {
        log.error("unmarshalWorkflowConfig failed",e);
        throw e;
      }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.wee.api.workflow.generated.WorkflowConf

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.