<?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: Workflow custom props update in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45074#M18218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK thanks Axel. Last thing (to achieve my initial target): could you please confirm that when setting process instance properties this way, these properties will become accessible&amp;nbsp;from Alfresco WorkflowService ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2018 07:46:13 GMT</pubDate>
    <dc:creator>vincent-kali</dc:creator>
    <dc:date>2018-08-06T07:46:13Z</dc:date>
    <item>
      <title>Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45067#M18211</link>
      <description>Hi all,I'm setting custom properties (defined on startTask model) when starting workflows.I want&amp;nbsp;to update some of these properties after the workflow starts.When trying to update startTask properties:this.services.getWorkflowService().updateTask(startTask.getId(), customProps, null, null);It fails</description>
      <pubDate>Thu, 02 Aug 2018 07:49:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45067#M18211</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-02T07:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45068#M18212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can never update a start task. Start tasks are "pseudo"-tasks - they technically do not exist. Using the Alfresco WorkflowService it is impossible to update workflow properties after a workflow has been started. Any update needs to happen as part of task / execution listeners within the workflow itself, i.e. you can set variables to update in a currently active task, and when that task is complete, a task listener copies the relevant&amp;nbsp;properties into the process instance / execution, where all the workflow properties are stored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 07:12:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45068#M18212</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-03T07:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45069#M18213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Axel for your response&lt;/P&gt;&lt;P&gt;I just want to query all workflow instances and return, for each of them a task status summary. I developped a REST API webscript to do that, but when querying tasks for each workflow instance, performances are catastrophic, that why my idea was to update workflow instance properties (adding a task summary to these properties)&amp;nbsp;to avoid task query on each workflow instance.&lt;/P&gt;&lt;P&gt;Then two questions:&lt;/P&gt;&lt;P&gt;- Would you have any advise to do that ?&lt;/P&gt;&lt;P&gt;- Why task queries performances are so poor ? Known issue ? Misconfiguration on my side ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 08:56:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45069#M18213</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-03T08:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45070#M18214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can still have a summary property on the workflow instance - you just need to set it from within the workflow itself using Activti APIs, not using the Alfresco WorkflowService.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why specifically the task queries would be slow for you - I've never had issues with those myself. You may have a badly optimised database, excessive query conditions, complex user-group relations (in case you are dealing with pooled tasks), or just too many tasks per workflow itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 13:02:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45070#M18214</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-03T13:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45071#M18215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Axel, when you say&lt;/P&gt;&lt;P&gt;"You can still have a summary property on the workflow instance - you just need to set it from within the workflow itself using Activti APIs, not using the Alfresco WorkflowService."&lt;/P&gt;&lt;P&gt;Do you&amp;nbsp;mean I can set and update a process variable with task summary information ?&lt;/P&gt;&lt;P&gt;In this case, how to access this variable from outside the workflow (WebScript) ?&lt;/P&gt;&lt;P&gt;Thanks for clarification..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VIncent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 13:24:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45071#M18215</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-03T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45072#M18216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In particular, could you share an example of 'setting it from within the workflow itself using Activti APIs'&lt;/P&gt;&lt;P&gt;Thanks in advance :&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 07:17:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45072#M18216</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-06T07:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45073#M18217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I shouldn't need to provide examples for this when the core engine and its APIs have been documented quite extensively, i.e. in the &lt;A href="https://www.activiti.org/userguide/#apiVariables" rel="nofollow noopener noreferrer"&gt;User Guide&lt;/A&gt;.&amp;nbsp;So when you have a TaskListener / ExecutionListener, all you need to do is use the provided execution to set variables on it. The only thing to keep in mind is that&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;you need to transform the prefixed QName of a property / association to use '_' instead of ':'&lt;/LI&gt;&lt;LI&gt;Node references need to be stored as ActivitiScriptNode / ActivitiScriptNodeList&lt;/LI&gt;&lt;LI&gt;if you want to transfer the value of a variable set on the task (via a form) to an identically named variable on the process, you need to explicity obtain the global execution / process instance via the Activiti RuntimeService&lt;BR /&gt;Code snippet: processInstance = execution.getEngineServices().getRuntimeService().createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult()&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 07:34:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45073#M18217</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-06T07:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45074#M18218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK thanks Axel. Last thing (to achieve my initial target): could you please confirm that when setting process instance properties this way, these properties will become accessible&amp;nbsp;from Alfresco WorkflowService ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 07:46:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45074#M18218</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-06T07:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45075#M18219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They become accesible from the WorkflowService &lt;STRONG&gt;provided&lt;/STRONG&gt; they have been defined in the model of the start task, which Alfresco uses to determine which variables get mapped in the API. I usually use a lot of aspects with optional properties for this, set on my start task via mandatory-aspects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 14:44:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45075#M18219</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-06T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45076#M18220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great ! I'll test this and post here results. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 14:49:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45076#M18220</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-08-06T14:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45077#M18221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still getting some issues when trying to set process custom properties and get it using worklflow service API.&lt;/P&gt;&lt;P&gt;Following axel recommendations, I did the following:&lt;/P&gt;&lt;P&gt;1) create aspect with optionnal properties and add it as mandatory aspect to process start task model&lt;/P&gt;&lt;P&gt;2) set these properties in ScriptTask / Scriptexecution listeners.&lt;/P&gt;&lt;P&gt;Result observed:&lt;/P&gt;&lt;P&gt;I defined two process listeners (org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener): one on 'start' event, one on 'end' event.&lt;/P&gt;&lt;P&gt;When setting the custom property by script on&amp;nbsp;start event execution listener, property is set and accessible using workflow service. When setting the property on 'end' event (or from any other ScriptExecutionListener/ScriptTaskListener), the property is not set (or not visilble from workflow service).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2018 14:59:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45077#M18221</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-09-26T14:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow custom props update</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45078#M18222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to complete this topic: as Axel explained above, any process property can be set from task/process activiti listener and read by workflow service as soon as the property is defined as a process (start task) property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Listener code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DelegateExecution execution = task.getExecution(); &lt;BR /&gt; ProcessInstance processInstance = execution.getEngineServices().getRuntimeService().createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult(); &lt;BR /&gt; execution.getEngineServices().getRuntimeService().setVariable(processInstance.getId(), "myPrefix_myProcessVariable", "myValue");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wf model&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Submit process task --&amp;gt;&lt;BR /&gt; &amp;lt;type name="&lt;SPAN&gt;myPrefix&lt;/SPAN&gt;:submitTask"&amp;gt;&lt;BR /&gt; &amp;lt;parent&amp;gt;bpm:startTask&amp;lt;/parent&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mandatory-aspects&amp;gt;&lt;BR /&gt;&amp;lt;aspect&amp;gt;&lt;SPAN&gt;myPrefix&lt;/SPAN&gt;:myAspect&amp;lt;/aspect&amp;gt;&lt;BR /&gt; &amp;lt;/mandatory-aspects&amp;gt;&lt;BR /&gt; &amp;lt;/type&amp;gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&amp;lt;aspect name="&lt;SPAN&gt;myPrefix&lt;/SPAN&gt;:&lt;SPAN&gt;myAspect&lt;/SPAN&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;properties&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;property name="&lt;SPAN&gt;myPrefix&lt;/SPAN&gt;:&lt;SPAN&gt;myProcessVariable&lt;/SPAN&gt;"&amp;gt;&lt;BR /&gt; &amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;BR /&gt; &amp;lt;mandatory&amp;gt;false&amp;lt;/mandatory&amp;gt;&lt;BR /&gt; &amp;lt;index enabled="true"&amp;gt;&lt;BR /&gt; &amp;lt;tokenised&amp;gt;false&amp;lt;/tokenised&amp;gt;&lt;BR /&gt; &amp;lt;facetable&amp;gt;true&amp;lt;/facetable&amp;gt;&lt;BR /&gt; &amp;lt;/index&amp;gt; &lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/properties&amp;gt;&lt;BR /&gt; &amp;lt;/aspect&amp;gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2018 09:22:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/workflow-custom-props-update/m-p/45078#M18222</guid>
      <dc:creator>vincent-kali</dc:creator>
      <dc:date>2018-12-27T09:22:07Z</dc:date>
    </item>
  </channel>
</rss>

