AnsweredAssumed Answered

How to get value of aspect association?

Question asked by pnature on Jun 13, 2017
Latest reply on Jun 14, 2017 by pnature

Hi

I am trying to get values of aspect association in alfresco bpmn workflow java task service but I have no luck.

When I have aspect only with string properties I have no problem to get values of aspect properties.

I have changed some properties to associations cm:person because I need select people from list and not to write them in form as strings.

I get values like this:

Map<QName,Serializable> docProperties = nodeService.getProperties(docref);
QName a = QName.createQName(namespace, varName);
Serializable personSer = docProperties.get(a);
username = personSer.toString();

This piece of java code list aspect's definition but only properties are listed.

Map<QName, PropertyDefinition> aspectPropDefs = dictionaryService.getAspect(aspectQname).getProperties();
for (QName propQName : aspectPropDefs.keySet())
{
   PropertyDefinition value = aspectPropDefs.get(propQName);
   if (value != null) {
      logger.debug("aspectProperty.key " + propQName.toString() + " = " + value); //nodeProps.containsKey(propQName)
   }
}


Please how to get values of aspect associations using java?
Thanks in advance.

Outcomes