AnsweredAssumed Answered

Only one of two behaviours for onUpdateProperties executed?

Question asked by hbf on Nov 15, 2007
Latest reply on Jan 4, 2008 by davidc
Hi,

My content type my:B inherits from my:A, and I have added a custom behaviour bA for my:A and another, different custom behaviour bB for my:B. Both listen for 'onUpdateProperties'.

If I edit a node of type my:A then bA (and only bA) is executed, as expected. However, if I edit my:B then only bB is exectued even though I would expect that both, bA and bB, should be executed.

Do I misunderstand behaviours here or have I run into a bug?

A first quick lock into AbstractNodeServiceImpl.java (in Alfresco SVN) seems to indicate that invokeOnUpdateProperties() only invokes a single policy – or does the latter call all the registered behaviours?

Many thanks for clarifications!
Kaspar

P.S. I am using SVN HEAD r1262.
P.P.S. With debugging for PolicyComponentImpl on, I get this output, if this should help:


20:24:52,079 User:System INFO  [repo.policy.PolicyComponentImpl] Bound Java method[class=org.myinstitute.module.KnowledgeCenter.behaviour.XHTMLPropertyBehaviour$UpdatePropertyBehaviourHandler, method=onUpdateProperties] to policy {http://www.alfresco.org}onUpdateProperties for class {http://www.mycompany.org/icar/model/knowledge_center/content/1.0}content

20:24:52,079 User:System INFO  [repo.policy.PolicyComponentImpl] Bound Java method[class=org.myinstitute.module.KnowledgeCenter.behaviour.XHTMLPropertyBehaviour$UpdatePropertyBehaviourHandler, method=onUpdateProperties] to policy {http://www.alfresco.org}onUpdateProperties for class {http://www.mycompany.org/icar/model/knowledge_center/content/1.0}profile

20:26:05,965 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@f5b949: wrapped 2 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}generalclassifiable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy
20:26:05,965 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=166672, method=public void org.alfresco.repo.rule.ruletrigger.SingleNodeRefPolicyRuleTrigger.policyBehaviour(org.alfresco.service.cmr.repository.NodeRef)], JavaBehaviour[instance=10648404, method=public void org.alfresco.repo.node.index.NodeIndexer.onUpdateNode(org.alfresco.service.cmr.repository.NodeRef)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}originable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy
20:26:05,966 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@57a295: wrapped 2 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}originable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy
20:26:05,966 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}versionable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,967 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@7316a3: wrapped 4 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}versionable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,967 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}titled] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,967 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@d35c64: wrapped 4 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}titled] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,967 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=5686356, method=public void org.myinstitute.module.KnowledgeCenter.behaviour.XHTMLPropertyBehaviour$UpdatePropertyBehaviourHandler.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}profile] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,967 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@737762: wrapped 5 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}profile] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,968 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}autolinkable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,968 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@a2d392: wrapped 4 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}autolinkable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,968 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}searchkeywordable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,968 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@f0562b: wrapped 4 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}searchkeywordable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.alfresco.org/model/application/1.0}inlineeditable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@a93482: wrapped 4 policies for ClassBinding[class={http://www.alfresco.org/model/application/1.0}inlineeditable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}author] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@b66688: wrapped 4 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}author] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}generalclassifiable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,969 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@59fe9: wrapped 4 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}generalclassifiable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,970 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=11479734, method=public void org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=14270785, method=public void org.alfresco.repo.content.RoutingContentService.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=12960317, method=public void org.alfresco.repo.node.integrity.IntegrityChecker.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)], JavaBehaviour[instance=1496032, method=public void org.alfresco.repo.node.integrity.IncompleteNodeTagger.onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef,java.util.Map,java.util.Map)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}originable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,970 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@45b78e: wrapped 4 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}originable] and policy interface org.alfresco.repo.node.NodeServicePolicies$OnUpdatePropertiesPolicy
20:26:05,975 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=3438604, method=public void org.alfresco.repo.version.VersionableAspect.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)], JavaBehaviour[instance=830835, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)], JavaBehaviour[instance=1908053, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}versionable] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,975 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@b55e7f: wrapped 3 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}versionable] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,975 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=830835, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)], JavaBehaviour[instance=1908053, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)]] for ClassBinding[class={http://www.alfresco.org/model/content/1.0}titled] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,975 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@4f006b: wrapped 2 policies for ClassBinding[class={http://www.alfresco.org/model/content/1.0}titled] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,976 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=830835, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)], JavaBehaviour[instance=1908053, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}profile] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,976 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface org.alfresco.repo.policy.PolicyFactory$MultiHandler@a4a43f: wrapped 2 policies for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}profile] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy
20:26:05,976 User:admin DEBUG [repo.policy.PolicyComponentImpl] Cached delegate interface collection [JavaBehaviour[instance=830835, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)], JavaBehaviour[instance=1908053, method=public void org.alfresco.repo.rule.ruletrigger.OnContentUpdateRuleTrigger.onContentUpdate(org.alfresco.service.cmr.repository.NodeRef,boolean)]] for ClassBinding[class={http://www.mycompany.org/icar/model/knowledge_center/content/1.0}autolinkable] and policy interface org.alfresco.repo.content.ContentServicePolicies$OnContentUpdatePolicy

(Search for "XHTMLPropertyBehaviour", which is registered twice, once for my:A, which is content, and once for my:B which is profile. However, only one of these behaviours is executed. The log is for saving an instance of my:B.)

Outcomes