<?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 Re: setProcessCustomProps task query: how to use in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66285#M22324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Yes, using the workflow start task would be the default way of adding these properties to the process instances. At runtime (inside an Activiti task / execution listener) you can also use the execution object to set variables - be aware though that there is a multi-level, inheritance-based isolation model for variables and as soon as a variable is set i.e. within the context of a process branch, it will be hard(er) to update the same-name variable on the global process instance scope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) What kind of example do you need? It is a simple setter which takes a map of&amp;nbsp;properties, so any example should be as simple as:&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;Map&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;QName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Serializable&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; processProps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;HashMap&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;processProps&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;put&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WorkflowModel&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PROP_SEND_EMAIL_NOTIFICATIONS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Boolean&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TRUE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="comment token"&gt;// ...&lt;/SPAN&gt;&lt;BR /&gt;taskQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setProcessCustomProps&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;processProps&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 12:56:17 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2018-03-16T12:56:17Z</dc:date>
    <item>
      <title>setProcessCustomProps task query: how to use</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66284#M22323</link>
      <description>Hi all,I want to add&amp;nbsp;some custom properties&amp;nbsp;to workflow instances of a custom activiti wf. These custom properties shoud be used by task queries in custom web scripts.Question 1: how to add properties to workflow instances ? (not to tasks) Using wf start task ?Question 2: where to find example on ho</description>
      <pubDate>Tue, 13 Mar 2018 22:22:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66284#M22323</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-03-13T22:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: setProcessCustomProps task query: how to use</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66285#M22324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Yes, using the workflow start task would be the default way of adding these properties to the process instances. At runtime (inside an Activiti task / execution listener) you can also use the execution object to set variables - be aware though that there is a multi-level, inheritance-based isolation model for variables and as soon as a variable is set i.e. within the context of a process branch, it will be hard(er) to update the same-name variable on the global process instance scope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) What kind of example do you need? It is a simple setter which takes a map of&amp;nbsp;properties, so any example should be as simple as:&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;Map&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;QName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Serializable&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; processProps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;HashMap&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;processProps&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;put&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WorkflowModel&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PROP_SEND_EMAIL_NOTIFICATIONS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Boolean&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TRUE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="comment token"&gt;// ...&lt;/SPAN&gt;&lt;BR /&gt;taskQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setProcessCustomProps&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;processProps&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 12:56:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66285#M22324</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-03-16T12:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: setProcessCustomProps task query: how to use</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66286#M22325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;Maybe I misunderstood something, but I can't find any way to read properties from a workflow instance in JAVA.&lt;/P&gt;&lt;P&gt;When adding&amp;nbsp;custom properties at workflow startup using&amp;nbsp;workflow start task, how to read these properties afterwards ? I can of course get the start task from workflow instance and read its properties like below, but I'm not sure it's the proper way to proceed....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WorkflowTask &lt;/SPAN&gt;&lt;SPAN&gt;startTask&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;workflowService&lt;/SPAN&gt;&lt;SPAN&gt;.getStartTask(&lt;/SPAN&gt;&lt;SPAN&gt;workflowInstance&lt;/SPAN&gt;&lt;SPAN&gt;.getId());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Map&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;QName&lt;SPAN&gt;,&lt;/SPAN&gt; Serializable&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt; processProps &lt;SPAN&gt;=&lt;/SPAN&gt; startTask&lt;/SPAN&gt;&lt;SPAN&gt;.getProperties&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;code/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps: stupid question: I can't find how to format code properly in this forum ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 15:27:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/setprocesscustomprops-task-query-how-to-use/m-p/66286#M22325</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-03-16T15:27:22Z</dc:date>
    </item>
  </channel>
</rss>

