<?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 Query an array variable in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193533#M146663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I read about why variables of type ByteArray cannot be queried and I understand that Blobs cannot be queried in the where-clause but I'm not sure what could be the better approach for my situation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- I have an&amp;nbsp; Array variable, lets say: validators = ["a","b","c"] stored in my activiti process &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- I want this variable to be an Array because I'm adding - removing elements to this Array with some taskListeners and finally this is the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;collection used as the input for a multiinstance task&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Somewhere (before multiinstance) in my business logic I have to search for all the processes with a variable "validators" that contains element "b" and I cannot query this variable because validators array is stored as a ByteArray variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nowadays I'm querying for all process that the variable "validators" is not null (&lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;runtimeService.createProcessInstanceQuery().variableValueLike("validators","%b%")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;) and doing some java-processing to get what I'm looking for but this is not an efficient way to do this kind of querys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can change this array variable to a String variable and store it like "a,b,c" and then do a variableLike query: &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;runtimeService.createProcessInstanceQuery().variableValueLike("validators","%b%")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; , but in this case I have to do StringToArray and ArrayToString transformations everywhere I need to deal with my validators array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I cannot find any other way to query my array variable, ¿Am I wrong? ¿Is there a better way to do this kinds of query?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jan 2015 08:17:29 GMT</pubDate>
    <dc:creator>javialfresco</dc:creator>
    <dc:date>2015-01-29T08:17:29Z</dc:date>
    <item>
      <title>Query an array variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193533#M146663</link>
      <description>I read about why variables of type ByteArray cannot be queried and I understand that Blobs cannot be queried in the where-clause but I'm not sure what could be the better approach for my situation:- I have an&amp;nbsp; Array variable, lets say: validators = ["a","b","c"] stored in my activiti process - I wan</description>
      <pubDate>Thu, 29 Jan 2015 08:17:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193533#M146663</guid>
      <dc:creator>javialfresco</dc:creator>
      <dc:date>2015-01-29T08:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query an array variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193534#M146664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No one is facing this kind of situation? Am i misusing activiti process variables?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 10:58:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193534#M146664</guid>
      <dc:creator>javialfresco</dc:creator>
      <dc:date>2015-02-09T10:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Query an array variable</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193535#M146665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Am i misusing activiti process variables?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;I do not think so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note 1: Long strings (&amp;gt;4000 chars) are stored in the blobs too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note 2: I would say that searching in blob (which serialize java array) depends on the DB vendor. (If the DB implementation supports it you can use it). In other case you have to parse variables in java.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note 3: You can implement your own type (e.g. for arrays) and store array values there (in the format which can DB query) similar to &lt;/SPAN&gt;&lt;CODE&gt;org.activiti.engine.impl.variable.LongStringType&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 11:55:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/query-an-array-variable/m-p/193535#M146665</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-02-09T11:55:14Z</dc:date>
    </item>
  </channel>
</rss>

