Try the following methods of NodeService:
getSourceAssocs(NodeRef nodeRef, QNamePattern qnamePattern) or
getTargetAssocs(NodeRef nodeRef, QNamePattern qnamePattern)
This may solve your problem.
Question
i refer this link but it does not work for me...
following code does not work :
String query = "PATH:\"/app:company_home/cm:Customer_Relationship_Management/cm:Business_Documents/cm:Orders/*\"+@crm\\:uniqueDocId:\"" + orderId + "\"";
List<NodeRef> nodeRefs = CRMUtils.executeLuceneQuery(query);
NodeRef parentRef = nodeRefs.get(0);
List<ChildAssociationRef> childRef = AlfrescoServiceRegistry.getServiceRegistry().getNodeService().getChildAssocs(parentRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
when i debugged this code i got parentRef and its correct but then following line i got empty childRef...
if you have any another solution then plz help me...
Solution
Try the following methods of NodeService:
getSourceAssocs(NodeRef nodeRef, QNamePattern qnamePattern) or
getTargetAssocs(NodeRef nodeRef, QNamePattern qnamePattern)
This may solve your problem.
OTHER TIPS
What is the name of your child association? The second parameter in getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) reflects association qname. Maybe your child association qname is not ContentModel.ASSOC_CONTAINS?