Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Obsolete COSMOS SDD Tooling BTG Rules"

(Resources)
(Resources)
Line 32: Line 32:
 
Our rules for merging should be the following:
 
Our rules for merging should be the following:
  
# Merge two resources when at least one of the resources has a parent that is ''not'' a resource.  
+
# Merge two matching resources when at least one of the resources has a parent that is ''not'' a resource.  
## If the resources are in different trees, the ancestry (parent resource and up) should be left in tact. Meaning, the resource with no parent will now have the same parent as the matching resource in the other tree. The resource with no parent will be removed from the root of the tree and merge in the tree with the resource that has a parent.
+
#* If the resources are in different trees, the ancestry (parent resource and up) should be left in tact. Meaning, the resource with no parent will now have the same parent as the matching resource in the other tree. The resource with no parent will be removed from the root of the tree and merge in the tree with the resource that has a parent.
## If the resources are in the same tree, the resource with no parent will be removed from the root of the tree and merged with the resource that has a parent.
+
#* If the resources are in the same tree, the resource with no parent will be removed from the root of the tree and merged with the resource that has a parent.
#
+
#* If both resources do not have parent resources, then the resource from one of the trees will be removed and merged with the other.
 +
#* During merging, the children of both objects will simply be copied in place to be handled by the second rule.
 +
# If two matching resources have the same parent in the same tree, then merge them.
 +
#* During merging, the children of both object will simply be copied in place to be handled by another firing of this rule.

Revision as of 11:38, 27 January 2008

This page holds ideas about how rules should be written for combining two SDDs together.

Rules

Our rules engine is Drools 4.0.4. Any discussion about rules should take this into consideration.

Resources

Resources can have any number of hosted resources, and those hosted resources can have any number of hosted resources, and etc. We need some rules to determine how to combine two trees from different descriptors.

Let's say we have the following two resource trees:

Tree 1:

A
  B
    C
  D
  E

Tree 2:

F
  A
    B
      C
  G

The same letters in different trees refer to the same resource and should be merge together when merging trees.

Our rules for merging should be the following:

  1. Merge two matching resources when at least one of the resources has a parent that is not a resource.
    • If the resources are in different trees, the ancestry (parent resource and up) should be left in tact. Meaning, the resource with no parent will now have the same parent as the matching resource in the other tree. The resource with no parent will be removed from the root of the tree and merge in the tree with the resource that has a parent.
    • If the resources are in the same tree, the resource with no parent will be removed from the root of the tree and merged with the resource that has a parent.
    • If both resources do not have parent resources, then the resource from one of the trees will be removed and merged with the other.
    • During merging, the children of both objects will simply be copied in place to be handled by the second rule.
  2. If two matching resources have the same parent in the same tree, then merge them.
    • During merging, the children of both object will simply be copied in place to be handled by another firing of this rule.

Back to the top