cancel
Showing results for 
Search instead for 
Did you mean: 

Only one of two behaviours for onUpdateProperties executed?

hbf
Champ on-the-rise
Champ on-the-rise
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.)
4 REPLIES 4

dgenard
Champ on-the-rise
Champ on-the-rise
We've the same issue with Alfresco 2.1.0E.
The only workaround we've found is to explicitely call the behaviour (in example onUpdateProperties) of my:A from the behaviour of my:B…

Denis

hbf
Champ on-the-rise
Champ on-the-rise
I guess with this confirmation, the issue is ready for inspection by Alfresco: Could an Alfresco engineer please take a look at this?

Many thanks!

hbf
Champ on-the-rise
Champ on-the-rise
Any news on this?

In particular, are we correct in assuming that, in the example from the original post, both behaviours should be called? Or is it our responsibility (and not Alfresco's) to call bA?

Thanks,
Kaspar

davidc
Star Contributor
Star Contributor
That is the behaviour as currently implemented.  So, you have to manually invoke behaviours of super types.

Raise a JIRA issue with an example of how you'd like to indicate that the overidden behaviour should be invoked (it's not always the case that it should) by the framework.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.