04-30-2008 05:11 AM
bpm_package.children[0].setPermission["John Doe, 'contributor' "];
04-30-2008 08:19 AM
bpm_package.children[0].setPermission("Editor","John Doe");
<task-node name="reviewTask">
<task name="ziswf:reviewTask" swimlane="quality_manager">
<event type="task-create">
<script>
</script>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var ziswfcontentdesc = bpm_package.children[0].properties["cm:description"];
if (ziswfcontentdesc != '')
{
taskInstance.setVariable("ziswf_fileDescription",ziswfcontentdesc);
}
//It works fine here
bpm_package.children[0].removePermission("All");
bpm_package.children[0].setPermission("Editor","lovrog");
</script>
</action>
</event>
<event type="task-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="ziswf_qmanager" access="write"/>
<expression>
if (taskInstance.actorId != null)
people.getPerson(taskInstance.actorId);
else
person;
</expression>
</script>
</action>
</event>
</task>
<transition name="reject" to="rejectedTask" />
<transition name="approve" to="isDirectApproved" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var carrier = ziswf_carrier.properties["cm:userName"];
bpm_package.children[0].properties["zis:QualityManager"]=ziswf_qmanager.properties["cm:userName"];
bpm_package.children[0].properties["zis:Requester"]=initiator.properties["cm:userName"];
var pendingfolder = companyhome.childByNamePath("/Intranet/Quality Management/Pending");
//Here is the problem, the following code marked as comment won't work
//bpm_package.children[0].takeOwnership();
//bpm_package.children[0].removePermission("All");
//bpm_package.children[0].setPermission("Editor", "zvonimirk");
bpm_package.children[0].save();
if (pendingfolder != null)
{
bpm_package.children[0].move(pendingfolder);
}
</script>
</action>
</transition>
</task-node>
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.