cancel
Showing results for 
Search instead for 
Did you mean: 

When node A is deleted, automatically delete node B too

nicolasraoul
Star Contributor
Star Contributor
Hello all,

My project has two spaces: originals and published.
When file3.doc is deleted in originals, then I want Alfresco to automatically delete file3.pdf in published.

It is my code that transforms file3.doc into file3.pdf in the first place, so I create a child association between the two. But when the father is removed, the child remains 😞

How can I do this?
Is the child association the way to go?
Or can content rules be triggered by a deletion?

Thanks a lot!
Nicolas
1 REPLY 1

neilm
Champ in-the-making
Champ in-the-making
Hi Nicolas,

If you have a look at this wiki page http://wiki.alfresco.com/wiki/Data_Dictionary_Guide, you'll get some good background information.

You need to distinguish between primary and non-primary child-associations. The former cascade the delete from the parent node to its children whilst the latter do not.
The former are what you get from e.g. nodeService.createNode() and the latter are what you get from e.g. nodeService.addChild()

Hope that helps!

Cheers,
Neil.