Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-4004

SI Graph manual-layout can be affected by location of components in XML file

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.6.4.RELEASE
    • Fix Version/s: None
    • Component/s: INTEGRATION, UI
    • Labels:
      None

      Description

      I have a Spring configuration XML file that includes the Spring Integration namespace. I have a workflow on the integration-graph that I edited in "manual layout" mode. If I go back to the "source" tab and change the location of some XML components (leaving the components themselves unchanged) depending on where the XML resides physically in the file when I return to the integration-graph tab components may or may not have moved around.

      The issue may happen because it appears when entering "manual layout" mode the coordinates are stored in the meta-data file (.settings/com.springsource.sts.config.flow.prefs) only for the components that are manually touched rather than for all components. As such when a component is moved around in the XML file it can influence the location of it in the integration-graph, just like it does in "automatic layout" mode.

      Steps to reproduce:

      1. Start with this XML file.
        <?xml version="1.0" encoding="UTF-8"?>
        <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:int="http://www.springframework.org/schema/integration" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
        
            <int:inbound-channel-adapter id="fileAdapter1" ref="fileReadingMessageSource1" method="receive" auto-startup="true" channel="files1">
                <int:poller fixed-delay="#{T(java.lang.Integer).MAX_VALUE}" />
            </int:inbound-channel-adapter>
            <bean id="fileReadingMessageSource" class="org.springframework.integration.file.FileReadingMessageSource">
                <property name="directory" value="C:/Users/af25830/Desktop/tmg-exchange-gateway-nam/t2" />
            </bean>
            <int:channel id="files1" />
            <int:logging-channel-adapter id="logger1" level="INFO" logger-name="fileLogger" channel="files1" auto-startup="false" />
        
        
            <int:inbound-channel-adapter id="fileAdapter2" ref="fileReadingMessageSource2" method="receive" auto-startup="true" channel="files2">
                <int:poller fixed-delay="#{T(java.lang.Integer).MAX_VALUE}" />
            </int:inbound-channel-adapter>
            <bean id="fileReadingMessageSource2" class="org.springframework.integration.file.FileReadingMessageSource">
                <property name="directory" value="C:/Users/af25830/Desktop/tmg-exchange-gateway-nam/t3" />
            </bean>
            <int:channel id="files2" />
            <int:logging-channel-adapter id="logger2" level="INFO" logger-name="fileLogger" channel="files2" auto-startup="false" />
        </beans>
        
      2. Open the integration-graph tab (mode should be "automatic layout").
        Graph looks like this.
      1. Enter "manual layout" mode. Move the position of the "logger2" component.
        Graph looks similar to this.
      1. Open the "source" tab. Move line 23 ("<int:channel id="files2" />") to line 6.
        XML file now looks like this.
        <?xml version="1.0" encoding="UTF-8"?>
        <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:int="http://www.springframework.org/schema/integration" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
        
            <int:channel id="files2" />
            <int:inbound-channel-adapter id="fileAdapter1" ref="fileReadingMessageSource1" method="receive" auto-startup="true" channel="files1">
                <int:poller fixed-delay="#{T(java.lang.Integer).MAX_VALUE}" />
            </int:inbound-channel-adapter>
            <bean id="fileReadingMessageSource" class="org.springframework.integration.file.FileReadingMessageSource">
                <property name="directory" value="C:/Users/af25830/Desktop/tmg-exchange-gateway-nam/t2" />
            </bean>
            <int:channel id="files1" />
            <int:logging-channel-adapter id="logger1" level="INFO" logger-name="fileLogger" channel="files1" auto-startup="false" />
        
        
            <int:inbound-channel-adapter id="fileAdapter2" ref="fileReadingMessageSource2" method="receive" auto-startup="true" channel="files2">
                <int:poller fixed-delay="#{T(java.lang.Integer).MAX_VALUE}" />
            </int:inbound-channel-adapter>
            <bean id="fileReadingMessageSource2" class="org.springframework.integration.file.FileReadingMessageSource">
                <property name="directory" value="C:/Users/af25830/Desktop/tmg-exchange-gateway-nam/t3" />
            </bean>
            <int:logging-channel-adapter id="logger2" level="INFO" logger-name="fileLogger" channel="files2" auto-startup="false" />
        </beans>
        

        Graph looks similar to this.

      Once someone decides to spend time manually laying out a graph they should not have to fear that their changes might be lost or messed up if they go and touch some "cosmetic" things in the XML file itself.
      To fix the issue perhaps if "manual layout" mode is selected determine the position of ALL components in the graph and save the exact position for all components, not just those touched.

      Few things to think about.

      • If a component changes more than cosmetically in the XML it's fair-game to be moved on the graph.
      • If a new component is inserted into the middle of the XML (as opposed to the end of the XML) after you've manually-edited a graph then you could either have it show on the graph
        • In the position that automatic-layout would have it appear (which may be overtop of some other components)
        • You could show it at the bottom of the page (which would not be where automatic-layout would normally put it).

        Attachments

        1. graph1.JPG
          graph1.JPG
          26 kB
        2. graph2.JPG
          graph2.JPG
          26 kB
        3. graph3.JPG
          graph3.JPG
          25 kB

          Activity

            People

            Assignee:
            aboyko Alex Boyko
            Reporter:
            tonyjoe Anthony Falabella
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: