How to get all child associations with a specific Type Alfresco Association (Java)

I am new to java and Alfresco, and I have this simple problem: I need to get all the child associations of noderef with the Association Type = "risposteAssociate". In Javascript, I am doing something like:

var risposte = node.childAssocs["crl:risposteAssociate"];

In Java, I should do something like:

List<ChildAssociationRef> risposteAssociate = nodeService.getChildAssocs(node,....);

I looked at the documents here , but I do not quite understand them.

EDIT. If I can get child associations to iterate over them, I can use

for (ChildAssociationRef childAssocRef : risposteAssociate) {
    // do something with each document in the workflow package
    NodeRef risposta = childAssocRef.getChildRef();

}

Thanx in advance

+3
source share
1 answer

I think you want getChildAssocs (NodeRef, QName, QName) callervice call. Sort of:

nodeService.getChildAssocs(parentNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
+6
source

All Articles