dependendKeysPerKey.put(D2WModel.PropertyTypeKey,v.clone());
dependendKeysPerKey.put(D2WModel.PropertyKeyPortionInModelKey,v.clone());
// then enumerate through all the rules; h
for (Enumeration e=rules().objectEnumerator(); e.hasMoreElements();) {
Rule r=(Rule)e.nextElement();
String rhsKey=r.rhs().keyPath();
Vector dependendantKeys=(Vector)dependendKeysPerKey.get(rhsKey);
if (dependendantKeys==null) {
dependendantKeys=new Vector();
dependendKeysPerKey.put(rhsKey,dependendantKeys);
}
ERDQualifierTraversal.traverseQualifier(r.lhs(),c);
for (Enumeration e2=c.keys.objectEnumerator(); e2.hasMoreElements(); ) {
String k=(String)e2.nextElement();
_addKeyToVector(k,dependendantKeys);
}
// also add those from the assignment
// if the assignment is delayed, do not add them here;
// they only need to be added if the key that the assignment computes is itself used
// on the left hand side
if (r.rhs() instanceof ERDComputingAssignmentInterface) {
Vector recipientForNewKeys=dependendantKeys;
if (r.rhs() instanceof ERDDelayedAssignment) {
// put those keys away, needed when reducing the graph and
recipientForNewKeys=(Vector)delayedDependendKeysPerKey.get(rhsKey);
if (recipientForNewKeys ==null) {
recipientForNewKeys =new Vector();
delayedDependendKeysPerKey.put(rhsKey, recipientForNewKeys);
}
}
NSArray extraKeys=((ERDComputingAssignmentInterface)r.rhs()).dependentKeys(rhsKey);
if (extraKeys!=null) {
for (Enumeration e6=extraKeys.objectEnumerator(); e6.hasMoreElements(); ) {
String k=(String)e6.nextElement();
_addKeyToVector(k, recipientForNewKeys);
}
}
} else if (r.rhs() instanceof DefaultAssignment) {
// special treatment for the only custom assignment coming for the D2W default rule set
// since it does not implement ERDComputingAssignmentInterface, we add the required keys explicitely here
// another way to do this would be to introduce a rule with the required keys in their LHS, but that is
// quite a few rules and this is a bit more self contained
_addKeyToVector("task", dependendantKeys);
_addKeyToVector("entity", dependendantKeys);
_addKeyToVector("propertyKey", dependendantKeys);
}
if(localizationEnabled && r.rhs() instanceof ERDLocalizableAssignmentInterface) {
_addKeyToVector("session.language", dependendantKeys);
}
c.keys=new NSMutableArray();
}
// we then reduce the graph