spring-webflow icon indicating copy to clipboard operation
spring-webflow copied to clipboard

State Level Multiple Inheritance [SWF-1682]

Open spring-operator opened this issue 9 years ago • 1 comments

Johannes Grimm opened SWF-1682 and commented

Currently Spring Web Flow supports multiple inheritance only on a flow level:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/webflow
        http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
    parent="parent-a,parent-b">
    ...
</flow>

Inheritance for states only supports single inheritance:

<flow>
    <view-state id="viewExample" parent="parent-flow#viewExample" />
</flow>

I would like to propose a patch that enables multiple inheritance for states to enable flow definitions like the following:

<flow>
    <view-state id="viewExample" parent="parent-a-flow#viewExample,parent-b-flow#viewExample" />
</flow>

I attached a minimal but complete example as [^state-multi-inheritance.zip]. The project already contains the required patches for spring web flow which are attached as [^patch.diff]. The modifications also handle special cases if a flow is inherited multiple times like given in the following example:

  • example-flow#state inherits from parent-a#state and parent-b#state
  • parent-a#state inherits from parent-c#state
  • parent-b#state inherits from parent-c#state

example-flow#state inherits parent-c#state two times but in the flow model the additions from parent-c#state should occur only once.


Affects: 2.4.2

Attachments:

spring-operator avatar Feb 26 '16 07:02 spring-operator

Rossen Stoyanchev commented

From a brief look the key concern I have is that view-state has a number of attributes and those cannot be reconciled in case of differences. The classical problem with multiple inheritance.

spring-operator avatar Feb 26 '16 15:02 spring-operator