AnsweredAssumed Answered

Behaviours not triggering consistently

Question asked by aweber1nj on Nov 20, 2012
Latest reply on Nov 21, 2012 by aweber1nj
Not entirely sure what to expect here.  Especially given that there was a presentation "promoting" the use of behaviours at DevCon, I would expect them to be pretty stable.

What I am seeing is that the "onRemoveAspect" for sys:incomplete is not consistently triggering my class.  Sometimes it does.  Sometimes it doesn't.  It may be that it is not triggering if the node is already running another behaviour-method (such as onUpdateProperties) – but that doesn't make a lot of sense, since Alfresco shouldn't care that both apply to the node, and it should trigger them both.

I have a logging statement as the first line in the method, and it doesn't show up in the log when you'd expect it – in fact, it doesn't show up ever for some of the nodes I'm testing with.  I know, based upon other logging that the node has sys:incomplete aspect (and it should, because there are mandatory properties missing).  After updating some properties, it should no longer have the aspect, and based upon the output of onUpdateProperties, and checking with node-browser, that is correct – the aspect is gone…but the code for onRemoveAspect never ran.

So are we to trust behaviours or not?  Are they "best effort", or "contractual"?  It makes a big difference when you're trying to code business logic.

Thanks,
AJ

Outcomes