Repository: telstra/open-kilda
Issue: Y-flow get paths response has incorrect diverse flows after update

**Steps to reproduce:**
1. Create a Y flow via `POST /v2/y-flows`

```
{
  "y_flow_id": "flow_1",
  "shared_endpoint": {
    "port_number": 10,
    "switch_id": "9"
  },
  "maximum_bandwidth": 10000,
  "ignore_bandwidth": true,
  "sub_flows": [
    {
      "flow_id": "sub_1",
      "endpoint": {
        "inner_vlan_id": 0,
        "port_number": 10,
        "switch_id": "2",
        "vlan_id": 123
      },
      "shared_endpoint": {
        "inner_vlan_id": 0,
        "vlan_id": 456
      }
    },
{
      "flow_id": "sub_2",
      "endpoint": {
        "inner_vlan_id": 0,
        "port_number": 10,
        "switch_id": "2",
        "vlan_id": 345
      },
      "shared_endpoint": {
        "inner_vlan_id": 0,
        "vlan_id": 789
      }
    }
  ]
}
```

2. Create another Y flow without diversity via `POST /v2/y-flows`
```
{
  "y_flow_id": "flow_2",
  "shared_endpoint": {
    "port_number": 10,
    "switch_id": "8"
  },
  "maximum_bandwidth": 10000,
  "ignore_bandwidth": true,
  "sub_flows": [
    {
      "flow_id": "sub_3",
      "endpoint": {
        "inner_vlan_id": 0,
        "port_number": 10,
        "switch_id": "3",
        "vlan_id": 111
      },
      "shared_endpoint": {
        "inner_vlan_id": 0,
        "vlan_id": 222
      }
    },
{
      "flow_id": "sub_4",
      "endpoint": {
        "inner_vlan_id": 0,
        "port_number": 10,
        "switch_id": "3",
        "vlan_id": 333
      },
      "shared_endpoint": {
        "inner_vlan_id": 0,
        "vlan_id": 444
      }
    }
  ]
}
```

3. Update the first flow to add diversity flow via `PATCH /v2/y-flows/flow_1`
```
{
"diverse_flow_id": "flow_2"
}
```

4. Get paths of both flows via `GET /v2/y-flows/{y_flow_id}/paths`

**Expected result:**
Each subflow must contain 3 other subflows in diverse group section (at this moment we see expected responses only if second flow was initially created with `"diverse_flow_id": "flow_1"`)
Expected responses are:
`flow_1`

```
{
******
  "sub_flow_paths":[
  {
    "flow_id":"sub_1",
    ******
    "diverse_group":{
    "other_flows":[
   { 
      "flowid":"sub_4",
      ***
   }, 
   {
      "flowid":"sub_3",
     ****
   },
   {
      "flowid":"sub_2",
    ******
    }
  ]
},
{
    "flow_id":"sub_2",
    *****
    "other_flows":[
    {
       "flowid":"sub_4",
    *****
     }, 
     {
         "flowid":"sub_3",
     *******
     },
     {
        "flowid":"sub_1",
        *******
       }
    ]
****
 }
```


`flow_2`

```
{
  *****
  "sub_flow_paths":[
    {
      "flow_id":"sub_4",
      *****
      "diverse_group":{
        "other_flows":[
          {
            "flowid":"sub_3",
            *****
          },
          {
            "flowid":"sub_2",
            *****
          },
          {
            "flowid":"sub_1",
            *****
          }
        ]
      },
    },
    {
      "flow_id":"sub_3",
      "diverse_group":{
        "other_flows":[
          {
            "flowid":"sub_4",
            *****
          },
          {
            "flowid":"sub_2",
            *****
          },
          {
            "flowid":"sub_1",
            *****
          }
        ]
      },
      *****
    }
  ]
}
```

**Actual result**
`flow_1`

```
{
  ****
  "sub_flow_paths":[
    {
      "flow_id":"sub_1",
      *****
      "diverse_group":{
        "other_flows":[
          {
            "flowid":"sub_4",
            ****
          },
          {
            "flowid":"sub_3",
            ****
          } 
            <<<<<<<<<<<< no info about sub_2
        ]
      },
      "protected_path":{
      }
    },
    {
      "flow_id":"sub_2",
      ****
      <<<<<<<<<<< no diverse_group at all
    }
  ]
}
```


`flow_2`

```
{
  *****
  "sub_flow_paths":[
    {
      "flow_id":"sub_3",
      *****
      "diverse_group":{
        "other_flows":[
          {
            "flowid":"sub_1",
            ****
          },
          {
            "flowid":"sub_4",
            *****
          }        <<<<<< no info about sub_2
        ]
      },
    },
    {
      "flow_id":"sub_4",
      "diverse_group":{
        "other_flows":[
          {
            "flowid":"sub_1",
            ****
          },
          {
            "flowid":"sub_3",
            ****              
          }         <<<<<< no info about sub_2
        ]
      },
    }
  ]
}
```

Changed files:
src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/fsm/yflow/update/actions/OnSubFlowUpdatedAction.java

diff --git a/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/fsm/yflow/update/actions/OnSubFlowUpdatedAction.java b/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/fsm/yflow/update/actions/OnSubFlowUpdatedAction.java
index 75437cd0a..633848c17 100644
--- a/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/fsm/yflow/update/actions/OnSubFlowUpdatedAction.java
+++ b/src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/fsm/yflow/update/actions/OnSubFlowUpdatedAction.java
@@ -59,6 +59,7 @@ public class OnSubFlowUpdatedAction extends
                     stateMachine.notifyEventListeners(listener ->
                             listener.onSubFlowProcessingStart(yFlowId, requestedFlowId));
                     CommandContext flowContext = stateMachine.getCommandContext().fork(requestedFlowId);
+                    requestedFlow.setDiverseFlowId(stateMachine.getDiverseFlowId());
                     flowUpdateService.startFlowUpdating(flowContext, requestedFlow, yFlowId);
                 }
             });