Package edu.indiana.extreme.xbaya.wf

Examples of edu.indiana.extreme.xbaya.wf.Workflow


  }

  private void loadLocalGraph(String graphFilePath) {
    try {
      Workflow workflow = new Workflow(XMLUtil.loadXML(new File(
          graphFilePath)));
      setWorkflow(workflow);
    } catch (GraphException e) {
      getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
    } catch (ComponentException e) {
View Full Code Here


  public Workflow[] harvest(Workflow workflow, QName dataType) {
    LinkedList<Workflow> harvest = new LinkedList<Workflow>();
    LinkedList<Pair<String, String>> candidates = getCandidates(workflow,
        dataType);
    for (Pair<String, String> pair : candidates) {
      Workflow clone = workflow.clone();

      NodeImpl node = clone.getGraph().getNode(pair.getLeft());
      if (null == node) {
        throw new XBayaRuntimeException("Specified node not found:"
            + pair.getLeft());
      }
      Port candidatePort = null;
      List<DataPort> inPorts = node.getInputPorts();
      for (DataPort dataPort : inPorts) {
        if (pair.getRight().equals(dataPort.getID())) {
          candidatePort = dataPort;
          break;
        }
      }
      if (null == candidatePort) {
        throw new XBayaRuntimeException("Specifies Port was not found:"
            + pair.getRight());
      }
      if (!(candidatePort.getFromNode() instanceof InputNode)) {
        removeUnnecessaryNodes(node, candidatePort, clone);
        Node input = clone.addNode(new InputComponent());
        input.setPosition(new Point(Math.max(0,
            node.getPosition().x - 150), node.getPosition().y));

        // the returned workflows size should be less than that of the
        // original
        if (clone.getGraph().getNodes().size() < workflow.getGraph()
            .getNodes().size()
            // if the sizes the different its a candidate, but need
            // to make sure
            // its not the same as one already harvested
            && !isWorkflowAlreadyHarvested(harvest, clone)) {
          try {
            clone.getGraph().addEdge(input.getOutputPort(0),
                candidatePort);
            cleanLeftOverInputNodes(clone);
          } catch (GraphException e) {
            throw new RuntimeException(e);
          }
View Full Code Here

    // new GPELClient()
    String userName = "chathura";
    String password = "changeme";
    String topic = "chathura_client";
    String workflowFile = "/nfs/mneme/home/users/cherath/projects/test/extremeWorkspace/xbaya/workflows/Vortex_Chathura_Dbg2.xwf";
    Workflow workflow = getWorkflow(workflowFile);

    List<WSComponentPort> inputs = workflow.getInputs();

    for (Iterator iterator = inputs.iterator(); iterator.hasNext();) {
      WSComponentPort componentPort = (WSComponentPort) iterator.next();
      if ("CrossCuttingConfigurations".equals(componentPort.getName())) {
        componentPort
View Full Code Here

    while (line != null) {
      wf += line;
      line = in.readLine();
    }

    Workflow workflow = new Workflow(wf);
    BPELScript bpel = new BPELScript(workflow);
    bpel.create(BPELScriptType.GPEL);
    workflow.setGpelProcess(bpel.getGpelProcess());
    workflow.setWorkflowWSDL(bpel.getWorkflowWSDL().getWsdlDefinitions());
    return workflow;

  }
View Full Code Here

    private void ok() {
        XRSearchResult result = this.list.getSelectedValue();
        hide();
        try {
      Workflow workflow = new XRegistryAccesser(this.engine).getWorkflow(result.getData().getName());
      XRegistryLoaderWindow.this.engine.setWorkflow(workflow);
    } catch (Exception e) {
      XRegistryLoaderWindow.this.engine.getErrorWindow().error(e);
    }
    }
View Full Code Here

    System.out.println("Workflow String  @@@@@@@@@@@@" + workflowTemplateName);
  //    Workflow xBayaWorkflow = xbayaODEClient.getWorkflow(URI.create(context.getXRegistryUrl()), context.getGssCredential(), workflowTemplateName);
//    TODO: Extract all inputs from front end and stuff into xbaya workflow object
   
  //  List<WSComponentPort> workflowInputs = xbayaODEClient.getInputs(xBayaWorkflow);
    Workflow xBayaWorkflow = null;
   
    try {
      String resource =  context.getRegistryClient().getOGCEResource(new QName(WORKFLOWQNAME,workflowTemplateName), ResourceType.WorkflowTemplate.toString(), null);
      XmlElement xwf = XMLUtil.stringToXmlElement(resource);
      xBayaWorkflow = new Workflow(xwf);
//   
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

  private static final Logger log = Logger.getLogger(XBayaWorkflowUtil.class);
    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();
//        }
       
View Full Code Here

      java.lang.String username,
      edu.indiana.extreme.xbaya.NameValue[] inputs,
      edu.indiana.extreme.xbaya.NameValue[] configurations) {
    System.err.println("Launch is called for topi:");
   
    Workflow workflow = null;
    try {
      workflow = new Workflow(workflowAsString);
      System.err.println("Workflow Object created");
    } catch (GraphException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    } catch (ComponentException e1) {
View Full Code Here

      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]);
View Full Code Here

        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 edu.indiana.extreme.xbaya.wf.Workflow

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.