Package org.apache.airavata.workflow.model.wf

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


        }

        final LinkedList<String> listOfValues = new LinkedList<String>();
        InterpreterUtil.getInputsForForEachNode(forEachNode, listOfValues, this.invokerMap);
        final Integer[] inputNumbers = InterpreterUtil.getNumberOfInputsForForEachNode(forEachNode, this.invokerMap);
        Workflow workflow1 = ((SubWorkflowNode) middleNode).getWorkflow();
        List<NodeImpl> nodes = workflow1.getGraph().getNodes();
        List<Node> wsNodes = new ArrayList<Node>();
        /* Take the List of WSNodes in the subworkflow */
        for (NodeImpl subWorkflowNode : nodes) {
          if (subWorkflowNode instanceof WSNode) {
            wsNodes.add(subWorkflowNode);
View Full Code Here


    public static LeadContextHeader buildLeadContextHeader(final XBayaEngine engine,
            MonitorConfiguration monitorConfiguration, String nodeId, LeadResourceMapping resourceMapping)
            throws URISyntaxException {

        XBayaConfiguration configuration = engine.getConfiguration();
        Workflow workflow = engine.getGUI().getWorkflow();

        LeadContextHeader leadContext = buildLeadContextHeader(workflow, configuration, monitorConfiguration, nodeId,
                resourceMapping);

        return leadContext;
View Full Code Here

    /**
     * Opens a current workflow from the local file.
     */
    public void openWorkflow() {
        Workflow workflow = null;
        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.graphFileChooser.getSelectedFile();
            logger.debug(file.getPath());

            try {
                String path = file.getPath();

                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
                    WSGraph graph = WSGraphFactory.createGraph(file);
                    workflow = Workflow.graphToWorkflow(graph);
                } else {
                    XmlElement workflowElement = XMLUtil.loadXML(file);
                    workflow = new Workflow(workflowElement);
                }
                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
                newGraphCanvas.setWorkflow(workflow);
                //this.engine.setWorkflow(workflow);
                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
View Full Code Here

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.graphFileChooser.getSelectedFile();
            try {

                String path = file.getPath();
                Workflow importedWorkflow;
                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
                    WSGraph importedGraph = WSGraphFactory.createGraph(file);
                    importedWorkflow = Workflow.graphToWorkflow(importedGraph);
                } else {
                    XmlElement importedWorkflowElement = XMLUtil.loadXML(file);
                    importedWorkflow = new Workflow(importedWorkflowElement);
                }
                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
                newGraphCanvas.setWorkflow(importedWorkflow);
                this.engine.getGUI().setWorkflow(importedWorkflow);
                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
View Full Code Here

    /**
     * @param workflow
     * @return
     */
    public Workflow getWorkflow() {
        Workflow workflow = null;
        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.graphFileChooser.getSelectedFile();
            logger.debug(file.getPath());

            try {
                String path = file.getPath();

                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
                    WSGraph graph = WSGraphFactory.createGraph(file);
                    workflow = Workflow.graphToWorkflow(graph);
                } else {
                    XmlElement workflowElement = XMLUtil.loadXML(file);
                    workflow = new Workflow(workflowElement);
                }

            } catch (IOException e) {
                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
            } catch (GraphException e) {
View Full Code Here

        this.listeners = new LinkedList<GraphCanvasListener>();

        // To avoid null check. Do not call newWorkflow() here because something
        // are not initialized yet at this point.
        this.workflow = new Workflow();
        this.graph = this.workflow.getGraph();
        engine.getConfiguration().registerExecutionModeChangeListener(this);
        graph.setName(generateNewWorkflowName());
        initGUI();
        executionModeChanged(engine.getConfiguration());
View Full Code Here

    /**
     * Creates a new graph.
     */
    public synchronized void newWorkflow() {
        Workflow newWorkflow = new Workflow();
        setWorkflow(newWorkflow);
    }
View Full Code Here

        newGraphCanvas.addGraphCanvasListener(new GraphCanvasListener() {

            public void graphCanvasChanged(GraphCanvasEvent event) {
                GraphCanvasEventType type = event.getType();
                final GraphCanvas graphCanvas = event.getGraphCanvas();
                final Workflow workflow = event.getWorkflow();
                switch (type) {
                case GRAPH_LOADED:
                case NAME_CHANGED:
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            String name = workflow.getName();

                            // Change the name of the tab.
                            updateTabTitle(graphCanvas, workflow);

                            // Change the name of the frame.
                            setFrameName(name);
                        }

           
                    });
                    break;
                case NODE_SELECTED:
                case INPUT_PORT_SELECTED:
                case OUTPUT_PORT_SELECTED:
                    // Do nothing
                case WORKFLOW_CHANGED:
                  updateTabTitle(graphCanvas,graphCanvas.getWorkflow());
                  setFrameName(workflow.getName());
                  for (ChangeListener listener:tabChangeListeners){
                    try{
                      listener.stateChanged(null);
                    }catch(Exception e){
                      e.printStackTrace();
                    }
                  }
                }
            }
            private void updateTabTitle(
          final GraphCanvas graphCanvas,
          final Workflow workflow) {
        int index = XBayaGUI.this.graphTabbedPane.indexOfComponent(graphCanvas.getSwingComponent());
                String newTitle = workflow.getName();
                if (graphCanvas.isWorkflowChanged()){
                  newTitle="*"+newTitle;
                }
        XBayaGUI.this.graphTabbedPane.setTitleAt(index, newTitle);
      }
View Full Code Here

        if (this.engine.getConfiguration().getWorkflow() != null) {
            this.newGraphCanvas(true, false);
            try {
              String xml = this.engine.getConfiguration().getAiravataAPI().getWorkflowManager().getWorkflowAsString(this.engine.getConfiguration().getWorkflow());
                XmlElement xwf = XMLUtil.stringToXmlElement(xml);
                Workflow workflow = new Workflow(xwf);
                setWorkflow(workflow);
            } catch (AiravataAPIInvocationException e) {
               getErrorWindow().error(ErrorMessages.REPOSITORY_CONFIGURATION_IS_WRONG_FAILED_TO_LOAD_THE_WORKFLOW, e);
            } catch (GraphException e) {
                getErrorWindow().error(ErrorMessages.WORKFLOW_IS_WRONG, e);
View Full Code Here

    private String setupAndLaunch(String workflowAsString, String topic, String gatewayId, String username,
                                  NameValue[] inputs,Map<String,String>configurations,boolean inNewThread,WorkflowContextHeaderBuilder builder) throws XMLStreamException, MalformedURLException, RepositoryException, RegistryException, AiravataAPIInvocationException {
        log.debug("Launch is called for topic:"+topic);

        Workflow workflow = null;
        try {
            workflow = new Workflow(workflowAsString);
            log.debug("Workflow Object created");
        } catch (GraphException e1) {
            e1.printStackTrace();
        } catch (ComponentException e1) {
            e1.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.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.