Hey everybody,
i found a solution to this problem. Apparently, there was a change of JavaScript engine used in activiti (engine embedded in Alfresco) from Rhino to Nashorn and that may have caused the issue i described above. Jeff Potts commited a few days ago to modify the script task and make it a service task using <code>org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate</code> Java class.
Instead of the old variable declaration, wich doesn't work anymore:
<code>
<scriptTask id="scripttask1" name="Submit" scriptFormat="javascript" activiti:autoStoreVariables="true">
<script>execution.setVariable('scwf_approveCount', 0); execution.setVariable('scwf_tpApproved', false);</script>
</scriptTask>
</code>
Here is the new way to write it using a service task:
<code>
<serviceTask id="scripttask1" name="Submit" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
<extensionElements>
<activiti:field name="runAs">
<activiti:string><![CDATA[admin]]></activiti:string>
</activiti:field>
<activiti:field name="script">
<activiti:string><![CDATA[
execution.setVariable('scwf_approveCount', 0);
execution.setVariable('scwf_tpApproved', false);
]]></activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
</code>
I have tested the changes, and now it works.