Package edu.indiana.extreme.xbaya.wf

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


     *
     * @param redeploy
     */
    public void deploy(final boolean redeploy) {
        this.canceled = false;
        final Workflow workflow = this.engine.getWorkflow();

        this.deployThread = new Thread() {
            @Override
            public void run() {
                runInThread(redeploy, workflow);
View Full Code Here


     * @param type
     */
    private void runInThread(URI templateID, WorkflowClient.WorkflowType type) {
        WorkflowClient client = GPELLoader.this.engine.getWorkflowClient();
        try {
            Workflow workflow = client.load(templateID, type);
            this.loadingDialog.hide();
            if (this.canceled) {
                return;
            }
            this.engine.setWorkflow(workflow);
View Full Code Here

     */
    public void test() throws IOException, ComponentException, GraphException,
            ComponentRegistryException, MonitorException {

        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        WorkflowClient.createScript(workflow);

        Monitor monitor;
        if (this.gui) {
            this.engine = new XBayaEngine(this.configuration);
            this.graphCanvas = this.engine.getGUI().getGraphCanvas();
            this.graphCanvas.setWorkflow(workflow);
            monitor = this.engine.getMonitor();
            this.engine.getGUI().eventReceived(new Event(Type.MONITOR_STARTED));
            repaintAndWait(2);
        } else {
            MonitorConfiguration monitorConfiguration = new MonitorConfiguration(
                    this.configuration.getBrokerURL(), this.configuration
                            .getTopic(), this.configuration.isPullMode(),
                    this.configuration.getMessageBoxURL());
            monitor = new Monitor(monitorConfiguration);
        }

        MonitorEventData eventData = monitor.getEventData();
        MonitorCallback callback = new MonitorCallback(eventData);
        LoopbackPublisher publisher = new LoopbackPublisher(callback,
                this.configuration.getTopic());
        MonitorNotifier notifier = new MonitorNotifier(publisher);

        executeToMiddle(workflow, notifier);

        modifyWorkflow(workflow);

        File modifiedWorkflowFile = new File(this.temporalDirectory,
                "complex-math-modified.xwf");
        XMLUtil.saveXML(workflow.toXML(), modifiedWorkflowFile);

        // Create a diff workflow
        WorkflowModifier modifier = new WorkflowModifier(workflow, eventData);
        Workflow diffWorkflow = modifier.createDifference();

        if (this.gui) {
            GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(true);
            canvas.setWorkflow(diffWorkflow);
            repaintAndWait(5);
        }

        File diffWorkflowFile = new File(this.temporalDirectory,
                "complex-math-diff.xwf");
        XMLUtil.saveXML(diffWorkflow.toXML(), diffWorkflowFile);

    }
View Full Code Here

    }

    public void openWorkflowTab(XBayaEngine engine) {
        WorkflowClient workflowClient = engine.getWorkflowClient();
        try {
            Workflow workflow = this.node.getComponent()
                    .getWorkflow(workflowClient);
            engine.getGUI().selectOrCreateGraphCanvas(workflow);
        } catch (GraphException e) {
            engine.getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
        } catch (WorkflowEngineException e) {
View Full Code Here

     * @throws IOException
     * @throws ComponentRegistryException
     */
    public void testWorkflow() throws ComponentException, GraphException,
            IOException, ComponentRegistryException {
        Workflow workflow = createWorkflow();

        File workflowFile = new File("tmp/ADASInitializedWRFForecast.xwf");
        XMLUtil.saveXML(workflow.toXML(), workflowFile);
    }
View Full Code Here

    /**
     * Opens a current workflow from the local file.
     */
    public void openWorkflow() {
      Workflow workflow = null;
        workflow = getWorkflow();
        if(null != workflow){
          this.engine.setWorkflow(workflow);
        }
    }
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.finest(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.getErrorWindow().error(
                        ErrorMessages.OPEN_FILE_ERROR, e);
View Full Code Here

            String path = file.getPath();
            if (!path.endsWith(XBayaConstants.WORKFLOW_FILE_SUFFIX)) {
                file = new File(path + XBayaConstants.WORKFLOW_FILE_SUFFIX);
            }

            Workflow workflow = this.engine.getWorkflow();
            try {
                XMLUtil.saveXML(workflow.toXML(), file);
            } catch (IOException e) {
                this.engine.getErrorWindow().error(
                        ErrorMessages.WRITE_FILE_ERROR, e);
            } catch (RuntimeException e) {
                this.engine.getErrorWindow().error(
View Full Code Here

        int returnVal = this.graphFileChooser.showOpenDialog(this.engine
                .getGUI().getFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.graphFileChooser.getSelectedFile();

            Workflow workflow = this.engine.getWorkflow();
            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);
                }
                workflow.importWorkflow(importedWorkflow);
                this.engine.setWorkflow(workflow);
            } catch (IOException e) {
                this.engine.getErrorWindow().error(
View Full Code Here

        File file = new File(XBayaPathConstants.WORKFLOW_DIRECTORY,
                "complex-math.xwf");
        XmlElement workflowXML = XMLUtil.loadXML(file);

        // Parse the workflow
        Workflow workflow = new Workflow(workflowXML);

        // Take out the graph of the workflow.
        Graph graph = workflow.getGraph();

        // Extract inputs of the workflow.
        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(graph);

        for (InputNode inputNode : inputNodes) {
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.