12-14-2015 05:58 AM
<userTask id="task1" name="task 1" activiti:candidateGroups="${swf_archive1.properties.authorityName}" activiti:formKey="swf:taskFirst">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[
//////////////some code
]]></activiti:string>
</activiti:field>
<activiti:field name="runAs">
<activiti:string><![CDATA[admin]]></activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="assignment" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[var userName = task.assignee;
for(var i = 0; i < bpm_package.children.length; i++) {
var resource = bpm_package.children;
if(!resource.getSiteShortName()){
resource.setPermission("Consumer", userName);
}
else
{
var siteName = resource.getSiteShortName();
var site = siteService.getSite(siteName);
if(!site.isMember(userName)){
resource.setPermission("Consumer", userName);
}
}
}]]></activiti:string>
</activiti:field>
<activiti:field name="runAs">
<activiti:string><![CDATA[admin]]></activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[
//////////////some code
]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
12-16-2015 04:21 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.