Package edu.indiana.extreme.xbaya.wf

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


      } catch (URISyntaxException e) {
        this.engine.getErrorWindow().error(e);
      }
    }

    final Workflow workflow = this.engine.getWorkflow();

    // Check whether the workflow name is Normalised

    WorkflowPropertyWindow workflowPropertyWindow = this.engine
        .getWorkflowPropertyWindow();

    if (!workflow.getName().equals(
        StringUtil.convertToJavaIdentifier(workflow.getName()))) {
      JOptionPane.showMessageDialog(this.engine.getGUI().getFrame(),
          "Invalid Name. Please consider a valid name.",
          "Invalid Name", JOptionPane.OK_OPTION);

      workflowPropertyWindow.show();
View Full Code Here


     */
    public WorkflowComponent getComponent(URI workflowID)
            throws ComponentRegistryException, ComponentException {

        try {
            Workflow workflow = this.workflowClient.load(workflowID, this.type);
            return new WorkflowComponent(workflow);
        } catch (WorkflowEngineException e) {
            throw new ComponentRegistryException(e);
        } catch (GraphException e) {
            throw new ComponentException(e);
View Full Code Here

    /**
     *
     */
    public void createDifference() {
        try {
            Workflow workflow = this.engine.getWorkflow();
            MonitorEventData eventData = this.engine.getMonitor()
                    .getEventData();
            WorkflowModifier modifier = new WorkflowModifier(workflow,
                    eventData);
            Workflow diffWorkflow = modifier.createDifference();
            GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(true);
            canvas.setWorkflow(diffWorkflow);
        } catch (MonitorException e) {
            this.engine.getErrorWindow().error(e);
        } catch (GraphException e) {
View Full Code Here

     */
    public void invokeModifiedWorkflow() {

        // TODO error handling

        Workflow workflow = this.engine.getWorkflow();
        Workflow diffWorkflow;
        try {
            MonitorEventData eventData = this.engine.getMonitor()
                    .getEventData();
            WorkflowModifier modifier = new WorkflowModifier(workflow,
                    eventData);
            diffWorkflow = modifier.createDifference();
            // open the diff in a new tab, but do not focus it.
            GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(false);
            canvas.setWorkflow(diffWorkflow);
        } catch (MonitorException e) {
            this.engine.getErrorWindow().error(e);
            return;
        } catch (GraphException e) {
            // This should not happen.
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            return;
        } catch (RuntimeException e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            return;
        }

        // Change the topic so that messages won't be mixed up with ones for the
        // original workflow.
        MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
                .getConfiguration();
        String newTopic = monitorConfiguration.getTopic() + "-diff";
        monitorConfiguration.setTopic(newTopic);

        // Invoke the workflow without showing the dialog.
        GPELInvoker invoker = new GPELInvoker(this.engine);

        try {
            WorkflowClient.createScript(diffWorkflow);
        } catch (GraphException e) {
            this.engine.getErrorWindow().error(e); // TODO
            return;
        }

        // Create a GUI without depending on the graph.

        // Set the default as an input.
        List<WSComponentPort> inputs;
        try {
            inputs = diffWorkflow.getInputs();
        } catch (ComponentException e) {
            // This should not happen when we create WSDL here, but if we use
            // precompiled workflow, it might happen.
            this.engine.getErrorWindow().error(
                    ErrorMessages.WORKFLOW_WSDL_ERROR, e);
            return;
        }
        for (WSComponentPort input : inputs) {
            String defaultValue = input.getDefaultValue();
            input.setValue(defaultValue);
        }

        invoker.invoke(diffWorkflow, inputs, true);

        // Change the ID of current display so that we can keep monitoring.
        URI instanceID = diffWorkflow.getGPELInstanceID();
        workflow.setGPELInstanceID(instanceID);
    }
View Full Code Here

     * @throws GraphException
     * @throws ComponentRegistryException
     */
    public Workflow createComplexMathWorkflow() throws ComponentException,
            GraphException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("Complex math workflow");
        workflow.setDescription("Complex math workflow");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component adderComp = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        Node adderNode2 = workflow.addNode(adderComp);
        adderNode2.setPosition(new Point(170, 210));

        // Multiplier node
        Component multiComp = this.componentRegistry
                .getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
        InputNode inputNode1 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode1.setPosition(new Point(20, 30));

        // Input node 2
        InputNode inputNode2 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode2.setPosition(new Point(20, 100));

        // Input node 3
        InputNode inputNode3 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode3.setPosition(new Point(20, 170));

        // Input node 4
        InputNode inputNode4 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode4.setPosition(new Point(20, 240));

        // Output
        OutputNode outputNode = (OutputNode) workflow
                .addNode(this.outputComponent);
        outputNode.setPosition(new Point(500, 130));

        // Connect ports
        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
View Full Code Here

     * @throws ComponentRegistryException
     */
    public Workflow createMathWithConstWorkflow() throws ComponentException,
            GraphException, ComponentRegistryException {

        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("Math with const");
        workflow.setDescription("Math with const");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

        // Input parameter node
        InputNode inputNode = (InputNode) workflow.addNode(this.inputComponent);
        inputNode.setPosition(new Point(50, 50));

        // Constant node
        ConstantNode constantNode = (ConstantNode) workflow
                .addNode(this.constantComponent);
        constantNode.setPosition(new Point(50, 120));

        // Output parameter
        OutputNode outParamNode = (OutputNode) workflow
                .addNode(this.outputComponent);
        outParamNode.setPosition(new Point(300, 220));

        // Connect ports
        graph.addEdge(inputNode.getOutputPort(0), adderNode.getInputPort(0));
View Full Code Here

     * @throws GraphException
     * @throws ComponentRegistryException
     */
    public Workflow createArrayWorkflow() throws ComponentException,
            GraphException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("Array test");
        workflow.setDescription("A workflow that tests arrays");

        Graph graph = workflow.getGraph();

        // n
        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
        inputN.setPosition(new Point(0, 80));

        // Array generator
        Component arrayGeneratorComponent = this.componentRegistry
                .getComponent(ArrayGenerator.WSDL_PATH);
        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
        arrayGenerator.setPosition(new Point(150, 80));

        // Array adder
        Component arrayAdderComponent = this.componentRegistry
                .getComponent(ArrayAdder.WSDL_PATH);
        Node arrayAdder = workflow.addNode(arrayAdderComponent);
        arrayAdder.setPosition(new Point(400, 80));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setConfiguredName("output");
        output.setPosition(new Point(550, 80));

        // Connect ports
        graph.addEdge(inputN.getOutputPort(0), arrayGenerator.getInputPort(0));
View Full Code Here

     * @throws GraphException
     * @throws ComponentRegistryException
     */
    public Workflow createForEachWorkflow() throws ComponentException,
            GraphException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("ForEach test");
        workflow.setDescription("Workflow that tests if");

        Graph graph = workflow.getGraph();

        // x
        InputNode inputX = (InputNode) workflow.addNode(this.inputComponent);
        inputX.setPosition(new Point(0, 0));

        // n
        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
        inputN.setPosition(new Point(0, 80));

        // Array generator
        Component arrayGeneratorComponent = this.componentRegistry
                .getComponent(ArrayGenerator.WSDL_PATH);
        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
        arrayGenerator.setPosition(new Point(120, 80));

        // Split
        Node split = workflow.addNode(this.splitComponent);
        split.setPosition(new Point(310, 80));

        // Adder
        Component adderComponent = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);
        Node adder = workflow.addNode(adderComponent);
        adder.setPosition(new Point(440, 40));

        // Merge
        Node merge = workflow.addNode(this.mergeComponent);
        merge.setPosition(new Point(580, 40));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setConfiguredName("output");
        output.setPosition(new Point(720, 40));

        // Connect ports
        graph.addEdge(inputX.getOutputPort(0), adder.getInputPort(0));
View Full Code Here

     * @throws ComponentException
     * @throws ComponentRegistryException
     */
    public Workflow createIfWorkflow() throws GraphException,
            ComponentException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("If test");
        workflow.setDescription("Workflow that tests if");

        Graph graph = workflow.getGraph();

        // x
        InputNode x = (InputNode) workflow.addNode(this.inputComponent);
        x.setPosition(new Point(10, 10));

        // y
        InputNode y = (InputNode) workflow.addNode(this.inputComponent);
        y.setPosition(new Point(10, 90));

        // const0
        ConstantNode const0 = (ConstantNode) workflow
                .addNode(this.constantComponent);
        const0.setPosition(new Point(20, 180));

        // if
        IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
        ifNode.setPosition(new Point(170, 180));

        // Adder nodes
        Component adderComp = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);

        Node adder = workflow.addNode(adderComp);
        adder.setPosition(new Point(400, 10));

        // Multiplier node
        Component multiComp = this.componentRegistry
                .getComponent(Multiplier.WSDL_PATH);

        Node multiplier = workflow.addNode(multiComp);
        multiplier.setPosition(new Point(400, 90));

        // endif
        Node endif = workflow.addNode(this.endifComponent);
        endif.setPosition(new Point(550, 40));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setConfiguredName("output");
        output.setPosition(new Point(700, 40));

        // Connect ports
        graph.addEdge(x.getOutputPort(0), adder.getInputPort(0));
View Full Code Here

     * @throws ComponentRegistryException
     * @throws ComponentException
     */
    public Workflow createReceiveWorkflow() throws GraphException,
            ComponentException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("Receive test");
        workflow.setDescription("Workflow that tests receive");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component echoComponent = this.componentRegistry
                .getComponent(Echo.WSDL_PATH);

        Node echo = workflow.addNode(echoComponent);
        echo.setPosition(new Point(40, 40));

        // receive
        ReceiveNode receive = (ReceiveNode) workflow
                .addNode(this.receiveComponent);
        receive.setPosition(new Point(200, 200));

        // Output
        OutputNode output1 = (OutputNode) workflow
                .addNode(this.outputComponent);
        output1.setPosition(new Point(350, 40));

        OutputNode output2 = (OutputNode) workflow
                .addNode(this.outputComponent);
        output2.setPosition(new Point(350, 200));

        // Connect ports
        graph.addEdge(receive.getEPRPort(), echo.getInputPort(0));
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.