Package org.ogce.expbuilder.model

Examples of org.ogce.expbuilder.model.ExpBldrWorkflow


      String experimentID = (String) application.createValueBinding("#{experiment.experiment.id}").getValue(facesContext);
      try {
        ExpBldrWorkflow[] workflowInstances = super.getContext().getExpBuilderManager().getWorkflowInstances(
            experimentID);
        //TODO: Currently only one workflow is being created per experiment, should be extended to hierarchial workflows
        ExpBldrWorkflow workflow = workflowInstances[0];
        this.setWorkflowID(workflow.getId());
        this.setWorkflowName(workflow.getName());
        this.setWorkflowDecription(workflow.getDescription());
      } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here


      context.getCredentials().setMyproxyUserName("");
      context.getCredentials().setMyproxyPassword("");
      context.login();
     
      xRegistryUrl = context.getXRegistryUrl();
      ExpBldrWorkflow expBldrWorkflow  =  xRegistryUtil.getWorkflowFromRegistry(workflowID, context);
     
      odeWorkflowManager.invokeWorkflow(expBldrWorkflow, context);
     
//     
//      System.out.println(expBldrWorkflow.getId());
View Full Code Here

    private GlobalContext globalContext;

  public ExpBldrWorkflow getWorkflowFromRegistry(String workflowTemplateName, ApplicationGlobalContext context){
   
    Workflow xBayaWorkflow = null;
    ExpBldrWorkflow expBldrWorkflow = new ExpBldrWorkflow();
    GSSCredential cred = null;
        try {
      FileInputStream fis = new FileInputStream(context.getProperties().getProperty("ssl.hostcertsKeyFile"));
      GlobusCredential globusCred = new GlobusCredential(fis);
      cred = new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT);
    } catch (Exception e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    ODEClient xbayaRegistryClient = new ODEClient();
   
//    if (workflowTemplateName.startsWith("http://extreme.indiana.edu/lead/workflow/")){
//      QName workflowQName = new QName(workflowTemplateName);
//      xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(xRegistryUrl), credential, workflowQName);
//    } else {
//      xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(xRegistryUrl), credential, workflowTemplateName);
//    } 
   
    if (workflowTemplateName.startsWith("http://extreme.indiana.edu/lead/workflow/")){
      String[] tokens = workflowTemplateName.split("/");
      workflowTemplateName = tokens[tokens.length - 1];
    }  
    //Fetch the required elements and load into to lighter experiment builder workflow model
    try {
      xBayaWorkflow = xbayaRegistryClient.getWorkflow(URI.create(context.getXRegistryUrl()), cred, workflowTemplateName);
     
      if (xBayaWorkflow != null){
        expBldrWorkflow.setId(xBayaWorkflow.getUniqueWorkflowName().toString());
        expBldrWorkflow.setName(xBayaWorkflow.getName());
        expBldrWorkflow.setDescription(xBayaWorkflow.getDescription());
        expBldrWorkflow.setWorkflowImage(xBayaWorkflow.getImage())
//        for (WSComponentPort wsComponentPort : inputs) {
//          wsComponentPort.setDefaultValue("<whateverxml/>");
//          wsComponentPort.getDescription();
//        }
       
        // Fetch All Workflow Inputs
        List<WSComponentPort> workflowInputs = xbayaRegistryClient.getInputs(xBayaWorkflow);
        LinkedList<Pair<WSComponentPort, String>> workflowInputExtensionPairs = new LinkedList<Pair<WSComponentPort, String>>();
       
        //Iterate through all inputs and determine extensions and stuff them into experiment builder workflow object
        for (WSComponentPort workflowInput : workflowInputs) {
          String inputExtension = null;
          if (workflowInput.getType().equals(ExperimentBuilderConstants.CROSSCUT_PARAMS_QNAME)) {
            inputExtension = ExperimentBuilderConstants.EXT_GEO_SPATIAL_TEMPORAL;
          } else if ((workflowInput.getType().getLocalPart().equals(ExperimentBuilderConstants.LEAD_FILE_ID_ARRAY_TYPE))) {
            inputExtension = ExperimentBuilderConstants.EXT_LEAD_QM_DATASEARCH;
          }
          workflowInputExtensionPairs.add(new Pair<WSComponentPort, String>(workflowInput,inputExtension));
            }
        expBldrWorkflow.setWorkflowInputExtensionPairs(workflowInputExtensionPairs);
      }
    } catch (Exception e) {
      log.error("Error Loading Workflow Object", e);
    }
View Full Code Here

        context.getCredentials().setMyproxyUserName("");
        context.getCredentials().setMyproxyPassword("");
        context.login();
       
        xRegistryUrl = context.getXRegistryUrl();
        ExpBldrWorkflow expBldrWorkflow  =  xRegistryUtil.getWorkflowFromRegistry(workflowID, context);
        System.out.println(expBldrWorkflow.getId());
        System.out.println(expBldrWorkflow.getName());
            System.out.println(expBldrWorkflow.getDescription());
            LinkedList<Pair<WSComponentPort, String>> workflowInputExtensionPairs = expBldrWorkflow.getWorkflowInputExtensionPairs();
            for (Pair<WSComponentPort, String> workflowInputExtensionPair : workflowInputExtensionPairs) {
              WSComponentPort input = workflowInputExtensionPair.getLeft();
              System.out.println(workflowInputExtensionPair.getRight());
              System.out.println(input.getName());
          System.out.println(input.getType());
View Full Code Here

      ArrayList<ExpBldrWorkflow> workflowsList = new ArrayList<ExpBldrWorkflow>();
 
    DocData[] docType = context.getRegistryClient().findOGCEResource("",
        ResourceType.WorkflowTemplate.toString(), null);
    for (DocData docData : docType) {
      ExpBldrWorkflow workflow = new ExpBldrWorkflow();
      workflow.setName(docData.resourcename);
      workflow.setId(docData.resourceID.toString());
      workflow.setDescription(docData.resourcedesc);
      workflow.setCreationDate(docData.created.getTime());
      workflowsList.add(workflow);
    }
     if (workflowsList.size() > 0) {
       workflows = workflowsList.toArray(new ExpBldrWorkflow[0]);
          }else{
View Full Code Here

      ArrayList<ExpBldrWorkflow> workflowsList = new ArrayList<ExpBldrWorkflow>();
     
      CapabilityToken[] docType = context.getRegistryClient().findCapability("", null,false, null);
    //FIXME : when we will change xbaya make this simple
    for (CapabilityToken docData : docType) {
      ExpBldrWorkflow workflow = new ExpBldrWorkflow();
      QName name = QName.valueOf(docData.getResourceID());
      workflow.setName(name.getLocalPart());
      workflow.setId(docData.getResourceID());
      String resource =  context.getRegistryClient().getResource(name);
      XmlElement xwf = XMLUtil.stringToXmlElement(resource);
      Workflow xbayaworkflow = new Workflow(xwf);
      xbayaworkflow.setName(name.getLocalPart());
      workflow.setDescription(xbayaworkflow.getDescription());
      workflow.setCreationDate(new Date());
      workflowsList.add(workflow);
    }
     if (workflowsList.size() > 0) {
       workflows = workflowsList.toArray(new ExpBldrWorkflow[0]);
          }else{
View Full Code Here

 
    DocData[] docType = context.getRegistryClient().findOGCEResource("",
        ResourceType.WorkflowInstance.toString(),
        ParentTypedID.getParentTypedID(ResourceType.Experiment, experimentID));
    for (DocData docData : docType) {
      ExpBldrWorkflow workflow = new ExpBldrWorkflow();
      workflow.setName(docData.resourcename);
      workflow.setId(docData.resourceID.toString());
      workflow.setDescription(docData.resourcedesc);
      workflow.setCreationDate(docData.created.getTime());
      workflowsList.add(workflow);
    }
     if (workflowsList.size() > 0) {
       workflows = workflowsList.toArray(new ExpBldrWorkflow[0]);
          }else{
View Full Code Here

    return ServiceConstants.SUCCESS_STATUS;
  }

  public ExpBldrWorkflow getWorkflow(String workflowID) throws Exception {
   
    ExpBldrWorkflow workflow = new ExpBldrWorkflow();
    String resource =  context.getRegistryClient().getOGCEResource(new QName(WORKFLOWQNAME,
        workflowID), ResourceType.WorkflowTemplate.toString(), null);
    if(resource == null){
      throw new Exception("Not able to find resource in Xregistry");
    }
    XmlElement xwf = XMLUtil.stringToXmlElement(resource);
    Workflow xbayaworkflow = new Workflow(xwf);
    ODEClient xbayaRegistryClient = new ODEClient();
    workflow.setName(xbayaworkflow.getName());
    workflow.setDescription(xbayaworkflow.getDescription());
    workflow.setWorkflowImage(xbayaworkflow.getImage());
    List<WSComponentPort> workflowInputs = xbayaRegistryClient.getInputs(xbayaworkflow);
    workflow.setWorkflowInputs(xbayaworkflow.getInputs());
    workflow.setWorkflow(xbayaworkflow);
    return workflow;
  }
View Full Code Here

TOP

Related Classes of org.ogce.expbuilder.model.ExpBldrWorkflow

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.