Examples of Workflow


Examples of nexj.core.meta.workflow.Workflow

         sWorkflowName = sWorkflowName.substring(0, i);
      }

      XMLMetadataHelper.validateName(sWorkflowName);

      final Workflow workflow = new Workflow(sWorkflowName);

      workflow.setResourceName(m_helper.getCurResourceName());
      workflow.setVersion(nVersion);
      workflow.setMetaclass(m_metadata.getMetaclass(XMLUtil.getReqStringAttr(workflowElement, "class")));

      workflow.setAttributes((Pair)m_helper.parse(
         XMLUtil.getStringAttr(workflowElement, "attributes"),
         true, null, null, m_metadata.getGlobalEnvironment()));

      workflow.setPrivileged(XMLUtil.getBooleanAttr(workflowElement, "privileged", workflow.isPrivileged()));
      workflow.setCaption(XMLUtil.getStringAttr(workflowElement, "caption"));

      String sVarList = XMLUtil.getStringAttr(workflowElement, "variables");

      if (sVarList != null)
      {
         for (StringTokenizer tokenizer = new StringTokenizer(sVarList); tokenizer.hasMoreTokens();)
         {
            String sVarName = tokenizer.nextToken();

            XMLMetadataHelper.validateName(sVarName);
            workflow.addVariable(new Variable(sVarName));
         }
      }

      if (isWorkflowHandler(workflowElement))
      {
         loadWorkflowHandler(workflowElement, workflow, workflow);
      }

      m_flowFixupList = new ArrayList();
      loadActivity(workflowElement.getFirstChild(), workflow);
      m_metadata.addWorkflow(workflow);
      m_helper.fixup(m_flowFixupList.iterator());
      m_flowFixupList = null;

      m_persistenceMappingFixupList.add(new ContextFixup(m_helper)
      {
         public void fixup()
         {
            workflow.resolve(m_machine);
         }
      });
   }
View Full Code Here

Examples of org.apache.airavata.model.Workflow

  public Workflow getWorkflow(String workflowTemplateId)
      throws InvalidRequestException, AiravataClientException,
      AiravataSystemException, TException {
    try {
      org.apache.airavata.workflow.model.wf.Workflow w = getAiravataAPI().getWorkflowManager().getWorkflow(workflowTemplateId);
      Workflow workflow = new Workflow();
      workflow.setTemplateId(workflowTemplateId);
      workflow.setGraph(XMLUtil.xmlElementToString(w.toXML()));
      workflow.setName(w.getName());
      return workflow;
    } catch (AiravataAPIInvocationException e) {
      String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
      log.error(msg, e);
      AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
View Full Code Here

Examples of org.apache.airavata.rest.mappings.resourcemappings.Workflow

        try {
            Map<String, String> workflows = airavataRegistry.getWorkflows();
            WorkflowList workflowList = new WorkflowList();
            List<Workflow> workflowsModels = new ArrayList<Workflow>();
            for (String workflowName : workflows.keySet()) {
                Workflow workflow = new Workflow();
                workflow.setWorkflowName(workflowName);
                workflow.setWorkflowGraph(workflows.get(workflowName));
                workflowsModels.add(workflow);
            }
            workflowList.setWorkflowList(workflowsModels);
            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
            builder.entity(workflowList);
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

                                Vector<RegistrySearchResult> results = new Vector<RegistrySearchResult>();
                                String val = null;
                                for (String key : keys) {
                                    val = resultList.get(key);
                                    try {
                    results.add(new RegistrySearchResult(new Workflow(val)));
                  } catch (GraphException e) {
                    e.printStackTrace();
                  } catch (ComponentException e) {
                    e.printStackTrace();
                  }
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

    private void ok() {
        RegistrySearchResult result = this.list.getSelectedValue();
        hide();

        try {
            Workflow workflow = new RegistryAccesser(this.engine).getWorkflow(result.getResourceName());
            GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
            newGraphCanvas.setWorkflow(workflow);
            //this.engine.setWorkflow(workflow);
            engine.getGUI().getGraphCanvas().setWorkflowFile(null);
//            RegistryLoaderWindow.this.engine.setWorkflow(workflow);
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

        Assert.assertTrue(airavataAPI.getApplicationManager().isApplicationDescriptorExists(
                serviceDescription.getType().getName(), hostDescription.getType().getHostName(),
                applicationDeploymentDescription.getType().getApplicationName().getStringValue()));

        log("Saving workflow ...");
        Workflow workflow = new Workflow(getWorkflowComposeContent("src/test/resources/EchoWorkflow.xwf"));
        airavataAPI.getWorkflowManager().addWorkflow(workflow);

        Assert.assertTrue(airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName()));

        log("Workflow setting up completed ...");

        runWorkFlow(workflow, Arrays.asList("echo_output=Airavata_Test"));
    }
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

        Assert.assertTrue(airavataAPI.getApplicationManager().isApplicationDescriptorExists(
                serviceDescription.getType().getName(), hostDescription.getType().getHostName(),
                applicationDeploymentDescription.getType().getApplicationName().getStringValue()));

        log("Saving workflow ...");
        Workflow workflow = new Workflow(getWorkflowComposeContent("src/test/resources/EchoWorkflow.xwf"));

        try {
            airavataAPI.getWorkflowManager().addWorkflow(workflow);
            Assert.fail("Workflow should already exists and should go to update.");
        } catch (DescriptorRecordAlreadyExistsException e) {

            log("Updating workflow...");
            airavataAPI.getWorkflowManager().updateWorkflow(workflow);
        }

        Assert.assertTrue(airavataAPI.getWorkflowManager().isWorkflowExists(workflow.getName()));

        log("Workflow setting up completed ...");

        try {
            runWorkFlowWithoutMonitor(workflow, Arrays.asList("echo_output=Airavata_Test"));
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

    public Workflow getOGCEWorkflow(QName workflowTemplateId) throws RepositoryException, GraphException,
            ComponentException, Exception {
        AiravataAPI registry = connectToRegistry();
        String xml = registry.getWorkflowManager().getWorkflowAsString(workflowTemplateId.getLocalPart());
        XmlElement xwf = XMLUtil.stringToXmlElement(xml);
        Workflow workflow = new Workflow(xwf);
        return workflow;
    }
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

     */
    public boolean saveWorkflow() {
        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
            try {

                Workflow workflow = this.engine.getGUI().getWorkflow();
                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());

                // Check if there is any errors in the workflow first.
                ArrayList<String> warnings = new ArrayList<String>();
                if (!script.validate(warnings)) {
                    StringBuilder buf = new StringBuilder();
                    for (String warning : warnings) {
                        buf.append("- ");
                        buf.append(warning);
                        buf.append("\n");
                    }
                    this.engine.getGUI().getErrorWindow().warning(buf.toString());
                    return false;
                }
                RegistryWorkflowPublisherWindow registryPublishingWindow = new RegistryWorkflowPublisherWindow(
                        this.engine);
                registryPublishingWindow.show();

                String workflowId = workflow.getName();

                workflowId = StringUtil.convertToJavaIdentifier(workflowId);

                QName workflowQName = new QName(XBayaConstants.OGCE_WORKFLOW_NS, workflowId);

                String workflowAsString = XMLUtil.xmlElementToString(workflow.toXML());
                String owner = this.engine.getConfiguration().getRegistryUserName();

                AiravataAPI registry = this.connectToRegistry();
                if (registry.getWorkflowManager().isWorkflowExists(workflow.getName())){
                registry.getWorkflowManager().updateWorkflow(workflow.getName(), workflowAsString);
              }else{
                registry.getWorkflowManager().saveWorkflow(workflowAsString);
              }
                if (registryPublishingWindow.isMakePublic()){
                 
                  registry.getWorkflowManager().publishWorkflow(workflow.getName());
                }
                registryPublishingWindow.hide();
                return true;
            } catch (Exception e) {
                this.engine.getGUI().getErrorWindow().error(e.getMessage(), e);
View Full Code Here

Examples of org.apache.airavata.workflow.model.wf.Workflow

     * @return
     */
    public Workflow getWorkflow(QName qname) throws AiravataAPIInvocationException {
        AiravataAPI registry = connectToRegistry();
        String xml = registry.getWorkflowManager().getWorkflowAsString(qname.getLocalPart());
        Workflow workflow = null;
        try {
            XmlElement xwf = XMLUtil.stringToXmlElement(xml);
            workflow = new Workflow(xwf);
        } catch (GraphException e) {
            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
        } catch (ComponentException e) {
            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.