<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get value of aspect association? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5242#M2564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to get values of&amp;nbsp;aspect association in alfresco bpmn workflow java task service but I have no luck.&lt;/P&gt;&lt;P&gt;When I have aspect only with string properties I have no problem to get values of aspect properties.&lt;/P&gt;&lt;P&gt;I have changed some properties to associations cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;erson because I need select people from list and not to write them in form as strings.&lt;/P&gt;&lt;P&gt;I get values like this:&lt;/P&gt;&lt;PRE&gt;Map&amp;lt;QName,Serializable&amp;gt; docProperties = nodeService.getProperties(docref);&lt;BR /&gt;QName a = QName.createQName(namespace, varName);&lt;BR /&gt;Serializable personSer = docProperties.get(a);&lt;BR /&gt;username = personSer.toString();&lt;/PRE&gt;&lt;P&gt;This piece of java code list aspect's definition but only properties are listed.&lt;/P&gt;&lt;PRE&gt;Map&amp;lt;QName, PropertyDefinition&amp;gt; aspectPropDefs = dictionaryService.getAspect(aspectQname).getProperties();&lt;BR /&gt;for (QName propQName : aspectPropDefs.keySet())&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PropertyDefinition value = aspectPropDefs.get(propQName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (value != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.debug("aspectProperty.key " + propQName.toString() + " = " + value); //nodeProps.containsKey(propQName)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Please how to get values of aspect associations using java?&lt;BR /&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jun 2017 17:05:08 GMT</pubDate>
    <dc:creator>pnature</dc:creator>
    <dc:date>2017-06-13T17:05:08Z</dc:date>
    <item>
      <title>How to get value of aspect association?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5242#M2564</link>
      <description>HiI am trying to get values of&amp;nbsp;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&lt;IMG id="smileytongue" class="emoticon emoticon-smileytongue" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;erson because I need select people f</description>
      <pubDate>Tue, 13 Jun 2017 17:05:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5242#M2564</guid>
      <dc:creator>pnature</dc:creator>
      <dc:date>2017-06-13T17:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get value of aspect association?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5243#M2565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The NodeService can retrieve the peer associations (getSourceAssociations, getTargetAssociations) and the child associations (getChildAssociations) for a given node: &lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://dev.alfresco.com/resource/AlfrescoOne/5.1/PublicAPI/org/alfresco/service/cmr/repository/NodeService.html" title="http://dev.alfresco.com/resource/AlfrescoOne/5.1/PublicAPI/org/alfresco/service/cmr/repository/NodeService.html" rel="nofollow noopener noreferrer"&gt;NodeService (Alfresco 5.1.3 Public Java API)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, if you are looking for a list of the associations defined for a type (not a node's actual associations) you can ask the DictionaryService by using getAllAssociations: &lt;A class="link-titled" href="http://dev.alfresco.com/resource/AlfrescoOne/5.1/PublicAPI/org/alfresco/service/cmr/dictionary/DictionaryService.html#getAllAssociations()" title="http://dev.alfresco.com/resource/AlfrescoOne/5.1/PublicAPI/org/alfresco/service/cmr/dictionary/DictionaryService.html#getAllAssociations()" rel="nofollow noopener noreferrer"&gt;DictionaryService (Alfresco 5.1.3 Public Java API)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 18:37:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5243#M2565</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2017-06-13T18:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get value of aspect association?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5244#M2566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for reply. I am interested in values.&lt;/P&gt;&lt;PRE&gt;QNamePattern matchAll=RegexQNamePattern.MATCH_ALL;&lt;BR /&gt;List&amp;lt;AssociationRef&amp;gt; tar = nodeService.getTargetAssocs(docref, matchAll);&lt;BR /&gt;logger.debug("TargetAssociationRef size= " + tar.size());&lt;BR /&gt;Iterator&amp;lt;AssociationRef&amp;gt; li = tar.iterator();&lt;BR /&gt;while (li.hasNext()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AssociationRef ar = li.next();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.debug("AssociationRef " + ar.getTypeQName());// + " src " + ar.getSourceRef() + " &amp;gt; " + ar.getTargetRef());&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;I can get associations this way but I don't know how to get values.&lt;/P&gt;&lt;P&gt;Can you give me snippet of code as an example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 06:54:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5244#M2566</guid>
      <dc:creator>pnature</dc:creator>
      <dc:date>2017-06-14T06:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get value of aspect association?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5245#M2567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;Now I have got it.&lt;/P&gt;&lt;PRE&gt;List&amp;lt;AssociationRef&amp;gt; tar = nodeService.getTargetAssocs(docref, QName.createQName(myNamespace, varName));&lt;BR /&gt;AssociationRef ar = tar.get(0);&lt;BR /&gt;Map&amp;lt;QName,Serializable&amp;gt; arProperties = nodeService.getProperties(ar.getTargetRef());&lt;BR /&gt;&lt;SPAN&gt;private static final String cmNamespace = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.alfresco.org/model/content/1.0" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.alfresco.org/model/content/1.0&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;String username = arProperties.get(QName.createQName(cmNamespace, "userName")).toString();&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 12:04:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-value-of-aspect-association/m-p/5245#M2567</guid>
      <dc:creator>pnature</dc:creator>
      <dc:date>2017-06-14T12:04:49Z</dc:date>
    </item>
  </channel>
</rss>

