07-13-2011 08:45 AM
workflow.getTaskById(PooledTaskid).properties["cm:owner"] = "admin";Is it really the property "owner" which i've to update?Map<QName, Serializable> params = new HashMap<QName, Serializable>();
params.put(ContentModel.PROP_OWNER, owner);
WorkflowTask updatedTask = workflowService.updateTask(taskId, params, null, null); Moreover, since 2009 the code could have change, isn't it?07-29-2011 10:00 AM
package org.alfresco.wftaskproperties;
public class UpdateTaskProperties extends BaseScopableProcessorExtension
{
private WorkflowService workflowService;
public void setWorkflowService(WorkflowService workflowService) {
this.workflowService = workflowService;
}
public void setTaskOwner(String taskId, String owner) throws IOException {
Map<QName, Serializable> params = new HashMap<QName, Serializable>();
params.put(ContentModel.PROP_OWNER, owner);
workflowService.updateTask(taskId, params, null, null);
}
}build a .class with it and place it in Alfresco\tomcat\webapps\alfresco\WEB-INF\classes<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="updateTaskProperties" parent="baseJavaScriptExtension"
class="org.alfresco.wftaskproperties.UpdateTaskProperties">
<property name="extensionName">
<value>updatetaskproperties</value>
</property>
<property name="workflowService">
<ref bean="WorkflowService"/>
</property>
</bean>
</beans>updatetaskproperties.setTaskAssignee(taskid, owner);and it's done!
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.