Package uk.org.ogsadai.client.toolkit.activities.generic

Examples of uk.org.ogsadai.client.toolkit.activities.generic.TraversableSingleActivityInput


        for (Object activity : workflow.getActivities())
        {
            ProcessingElement pe = (ProcessingElement)activity;
            if (pe.getActivityName().equals("1"))
            {
                TraversableSingleActivityInput input = pe.getInput("control");
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
                input = pe.getInput("input");
                output = (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
            }
            else if (ControlledRepeat.DEFAULT_ACTIVITY_NAME.equals(pe.getActivityName()))
            {
                TraversableSingleActivityInput input = pe.getInput(ControlledRepeat.INPUT_CONTROL);
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        "2",
                        output.getActivity().getActivityName().toString());
            }
View Full Code Here


        {
            ProcessingElement pe = (ProcessingElement)activity;
            if ("1".equals(pe.getActivityName().toString())
                    || "3".equals(pe.getActivityName().toString()))
            {
                TraversableSingleActivityInput input = pe.getInput("control");
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
                input = pe.getInput("input");
                output = (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
            }
            else if (ControlledRepeat.DEFAULT_ACTIVITY_NAME.equals(pe.getActivityName()))
            {
                TraversableSingleActivityInput input = pe.getInput(ControlledRepeat.INPUT_CONTROL);
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertTrue("2".equals(output.getActivity().getActivityName().toString())
                        || "4".equals(output.getActivity().getActivityName().toString()));
            }
        }
View Full Code Here

        for (Object activity : workflow.getActivities())
        {
            ProcessingElement pe = (ProcessingElement)activity;
            if ("1".equals(pe.getActivityName().toString()))
            {
                TraversableSingleActivityInput input = pe.getInput("control");
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
                pe = (ProcessingElement) output.getActivity();
                input = pe.getInput("input");
                assertTrue(input.isLiteral());
                assertEquals("Y", input.getDataValues()[0].toString());
                assertEquals("Z", input.getDataValues()[1].toString());
                input = pe.getInput("repeatedInput");
                assertTrue(input.isLiteral());
                assertEquals("X", input.getDataValues()[0].toString());
            }
        }
    }
View Full Code Here

        {
            ProcessingElement pe = (ProcessingElement)activity;
            if ("1".equals(pe.getActivityName().toString()))
            {
                // test for control input values
                TraversableSingleActivityInput input = pe.getInput("control");
                TraversableSingleActivityOutput output =
                    (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
                input = ((ProcessingElement)output.getActivity()).getInput("repeatedInput");
                assertTrue(input.isLiteral());
                assertEquals("Y", input.getDataValues()[0].toString());
                input = ((ProcessingElement)output.getActivity()).getInput("input");
                output = (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
               
                input = pe.getInput("input1");
                output = (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
                input = ((ProcessingElement)output.getActivity()).getInput("repeatedInput");
                assertTrue(input.isLiteral());
                assertEquals("X", input.getDataValues()[0].toString());
                input = ((ProcessingElement)output.getActivity()).getInput("input");
                assertTrue(input.isLiteral());
                assertEquals("1", input.getDataValues()[0].toString());
                assertEquals("2", input.getDataValues()[1].toString());

                input = pe.getInput("input2");
                output = (TraversableSingleActivityOutput)input.getConnectedOutput();
                assertNotNull(output);
                assertEquals(
                        ControlledRepeat.DEFAULT_ACTIVITY_NAME,
                        output.getActivity().getActivityName());
View Full Code Here

            new PartitionedGraphToWorkflows(factory, factory, mapper, null);
        toWF.createWorkflows(graph);
        PipelineWorkflow workflow = toWF.getWorkflows().values().iterator().next();
        ProcessingElement pe = (ProcessingElement) workflow.getActivities().iterator().next();
        assertEquals("1", pe.getActivityName().toString());
        TraversableSingleActivityInput input = pe.getInput("input1");
        DataValue[] data = input.getDataValues();
        for (DataValue value : data)
        {
            assertEquals("X", value.toString());
        }
        input = pe.getInput("input2");
        data = input.getDataValues();
        for (int i=0; i<data.length;)
        {
            assertEquals("[", data[i++].toString());
            assertEquals("Y", data[i++].toString());
            assertEquals("]", data[i++].toString());
View Full Code Here

        }
       
        // reconnect the activity that is producing the control data stream
        RequestNodeInput controlInput =
            GraphUtilities.getRequestNodeInput(connection, node);
        TraversableSingleActivityInput input =
            (TraversableSingleActivityInput)targetActivity.getInput(
                controlInput.getName(),
                controlInput.getIndex());
        if (input.isLiteral())
        {
            controlledRepeat.addInput(
                    ControlledRepeat.INPUT_CONTROL,
                    input.getDataValues());
        }
        else
        {
            TraversableSingleActivityOutput output =
                (TraversableSingleActivityOutput) input.getConnectedOutput();
            controlledRepeat.connectInput(
                    ControlledRepeat.INPUT_CONTROL,
                    output);
        }
       
        // reconnect the target activity's inputs
        input.disconnect();
        ((TraversableSingleActivityInput)targetActivity.getInput(
                    target.getName(),
                    target.getIndex())).disconnect();
       
        targetActivity.connectInput(
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.client.toolkit.activities.generic.TraversableSingleActivityInput

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.