Package edu.indiana.extreme.xbaya.wf

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


     * @throws ComponentRegistryException
     */
    public void testRemoveNode() throws ComponentException, GraphException,
            ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createSimpleMathWorkflow();
        Graph graph = workflow.getGraph();

        Node node = graph.getNode("Adder_add");
        assertNotNull(node);
        int originalSize = graph.getPorts().size();
        int portNum = node.getAllPorts().size();
View Full Code Here


     * @throws ComponentRegistryException
     */
    public void testSimpleMath() throws ComponentException, GraphException,
            IOException, ComponentRegistryException {

        Workflow workflow = this.graphCreater.createSimpleMathWorkflow();

        File workflowFile = new File("tmp/simple-math.xwf");
        XMLUtil.saveXML(workflow.toXML(), workflowFile);

        // Creates a Jython script
        File jythonFile = new File("tmp/simple-math.py");
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
View Full Code Here

     * @throws IOException
     * @throws ComponentRegistryException
     */
    public void testComplexMath() throws ComponentException, GraphException,
            IOException, ComponentRegistryException {
        Workflow workflow = this.graphCreater.createComplexMathWorkflow();
        File graphFile = new File("tmp/complex-math.xwf");
        XMLUtil.saveXML(workflow.toXML(), graphFile);

        // Creates a Jython script
        File jythonFile = new File("tmp/complex-math.py");
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
View Full Code Here

    HashMap<Node, Node> nodeMap = new HashMap<Node, Node>();
    for (Node node : subworkflowNodes) {
      nodeMap.put(node, node);
    }

    Workflow clone = oldWorkflow.clone();
    clone.setName(clone.getName() + "_subWorkflow");
    List<NodeImpl> allOldNodes = clone.getGraph().getNodes();
    for (NodeImpl nodeImpl : allOldNodes) {
      if (null == nodeMap.get(nodeImpl)) {
        clone.removeNode(nodeImpl);
      }
    }

    // clone nodes and set it to this graph
    for (Node node : subworkflowNodes) {
View Full Code Here

    /**
     * @throws IOException
     * @throws XBayaException
     */
    public void test() throws IOException, XBayaException {
        Workflow subWorkflow = this.workflowCreator.createSimpleMathWorkflow();

        URI subWorkflowID = this.workflowClient.createScriptAndDeploy(subWorkflow,
                false);
        Workflow workflow = createHierarchicalWorkflow(subWorkflowID);
        File file = new File(this.temporalDirectory, "hierarchical-test.xwf");
        XMLUtil.saveXML(workflow.toXML(), file);

        URI workflowTemplateID = this.workflowClient.createScriptAndDeploy(
                workflow, false);
        logger.info("workflowTemplateID: " + workflowTemplateID);

        // Instantiate the workflow template.
        GcInstance instance = this.workflowClient.instantiate(workflow,
                this.configuration.getDSCURL());

        // ID to retrieve the workflow instance
        URI instanceID = instance.getInstanceId();
        logger.info("instanceID: " + instanceID);

        // Start the workflow instance.
        WsdlDefinitions wsdl = this.workflowClient.start(instance);

        // Create lead context.
        LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
        leadContextHelper.setXBayaConfiguration(this.configuration);
        LeadContextHeader leadContext = leadContextHelper
                .getLeadContextHeader();

        URI messageBoxURL = null;
        if (this.configuration.isPullMode()) {
            messageBoxURL = this.configuration.getMessageBoxURL();
        }

        // Create a invoke to invoke the workflow instance.
        LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
                leadContext, messageBoxURL);

        // Set the input values to the invoker.
        // Get the input information
        List<WSComponentPort> inputs = workflow.getInputs();

        for (WSComponentPort input : inputs) {
            // Show the information of each input.

            // Name
View Full Code Here

    }

    private Workflow createHierarchicalWorkflow(URI subWorkflowID)
            throws ComponentRegistryException, ComponentException,
            GraphException {
        Workflow workflow = new Workflow();

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

        Graph graph = workflow.getGraph();

        // Input 1
        InputComponent inputComponent = new InputComponent();
        InputNode input1 = (InputNode) workflow.addNode(inputComponent);
        input1.setPosition(new Point(50, 50));

        // Input 2
        InputNode input2 = (InputNode) workflow.addNode(inputComponent);
        input2.setPosition(new Point(50, 150));

        InputNode input3 = (InputNode) workflow.addNode(inputComponent);
        input3.setPosition(new Point(50, 250));

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

        // Sub workflow
        WorkflowComponent subWorkflowComponent = this.gpelComponentRegistry
                .getComponent(subWorkflowID);
        Node subWorkflow = workflow.addNode(subWorkflowComponent);
        subWorkflow.setPosition(new Point(350, 150));

        // Output
        OutputComponent outputComponent = new OutputComponent();
        OutputNode outParamNode = (OutputNode) workflow
                .addNode(outputComponent);
        outParamNode.setPosition(new Point(800, 150));

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

     * @throws ComponentRegistryException
     */
    public void XtestDeploy() throws ComponentException, GraphException,
            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        workflow.setName("this is test name");
        workflow.setDescription("this is test description");
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);

        GcSearchList list = client.list();
        for (GcSearchResult result : list.results()) {
            logger.info(result.getTitle());
        }

        client.load(workflow.getGPELTemplateID());
    }
View Full Code Here

    item.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent event) {
                new Thread() {
                    @Override
                    public void run() {
                      Workflow workflow = new WorkflowFiler(ComponentMenu.this.engine).getWorkflow();
//                      //to normalize and build the scripts
//                      new ODEClient().getInputs(workflow);
                      try {
                        ComponentMenu.this.engine.addWorkflowComponent(workflow.getName(), SubWorkflowComponent.getInstance(workflow));
             
            } catch (ComponentException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
View Full Code Here

     * @throws ComponentRegistryException
     */
    public void XtestRedeploy() throws ComponentException, GraphException,
            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);

View Full Code Here

     * @throws ComponentRegistryException
     */
    public void XtestStart() throws ComponentException, GraphException,
            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createSimpleMathWorkflow();

        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);
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.