mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

abobrov
30.16.2008 cec880d908a0dab559f4c55e4a0a1aa607594617
- fix out of order workflow node insertion to cater for cases when a node being inserted has both child and parent nodes already registered in the workflow topology.

2 files modified
19 ■■■■ changed files
opends/src/server/org/opends/server/core/NetworkGroup.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/WorkflowTopologyNode.java 15 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/NetworkGroup.java
@@ -225,7 +225,7 @@
        if (curNode.insertSubordinate(workflowNode))
        {
          // new workflow has been inserted in the topology
          break;
          continue;
        }
        // ... or try to insert the existing workflow below the new
@@ -233,7 +233,7 @@
        if (workflowNode.insertSubordinate(curNode))
        {
          // new workflow has been inserted in the topology
          break;
          continue;
        }
      }
opends/src/server/org/opends/server/core/WorkflowTopologyNode.java
@@ -299,6 +299,12 @@
      WorkflowTopologyNode newWorkflow
      )
  {
    // Dont try to add the workflow to itself.
    if (newWorkflow == this)
    {
      return;
    }
    // Check whether subordinates of current workflow should move to the
    // new workflow subordinate list.
    ArrayList<WorkflowTopologyNode> curSubordinateList =
@@ -308,10 +314,17 @@
    {
      DN newDN = newWorkflow.getBaseDN();
      DN subordinateDN = curSubordinate.getBaseDN();
      // Dont try to add workflow when baseDNs are
      // the same on both workflows.
      if (newDN.equals(subordinateDN)) {
        return;
      }
      if (subordinateDN.isDescendantOf(newDN))
      {
        removeSubordinate(curSubordinate);
        newWorkflow.addSubordinateNoCheck(curSubordinate, newWorkflow);
        newWorkflow.addSubordinate(curSubordinate);
      }
    }