AnsweredAssumed Answered

activiti: how to execute a script as if I was an admin

Question asked by kriton on Mar 26, 2012
Latest reply on Apr 19, 2013 by pjaromin
Hello,

I am having a problem with running a script inside an activiti task.
Some tasks are assigned to users who have no access permissions to certain files that need to be changed via a script on that part of the task. The most sane thing for me to do would be ro run that script as an admin, but I cant figure out how.

I've tried this:

<activiti:taskListener event="assignment" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
  <extensionElements>
    <activiti:field name="script"><activiti:string>my script is here</activiti:string>
    <activiti:field name="runAs"><activiti:string>admin</activiti:string>
  <extensionElements>
</activiti:taskListener>

but it does not work.

This (jbpm way) does not work either.
<runas>admin</runas>

Any other ideas are welcome too ;)

Outcomes