Cherry
Cherry

Reputation: 33544

How detemine what user was assigned to the task in alfresco?

A command desc task activiti$99 executed in alfresco gave the following:

id: activiti$99
name: sc:startProcesstask
title: Add information to request
description: Add information to request
state: IN_PROGRESS
path: activiti$41
transitions: 1
 transition: Next , title: Задача выполнена , desc: Задача выполнена
properties: 28
 {http://www.alfresco.org/model/bpm/1.0}workflowDueDate = null
 {http://www.alfresco.org/model/content/1.0}created = Thu Oct 20 13:58:28 KRAT 2016
 {http://www.alfresco.org/model/bpm/1.0}workflowDescription = 
 {http://www.alfresco.org/model/bpm/1.0}percentComplete = 0
 {http://www.mycompany.com/model/request-workflow/1.0}comment = 
 {http://www.mycompany.com/model/request-workflow/1.0}requestId = 
 {http://www.mycompany.com/model/request-workflow/1.0}codeForArchive = 
 {http://www.alfresco.org/model/bpm/1.0}pooledActors = []
 {http://www.alfresco.org/model/content/1.0}name = Task
 {http://www.alfresco.org/model/bpm/1.0}packageActionGroup = add_package_item_actions
 {http://www.alfresco.org/model/bpm/1.0}reassignable = true
 {http://www.alfresco.org/model/bpm/1.0}workflowPriority = 2
 {http://www.alfresco.org/model/content/1.0}owner = null
 {http://www.alfresco.org/model/bpm/1.0}taskId = 99
 {http://www.mycompany.com/model/request-workflow/1.0}name = 
 {http://www.mycompany.com/model/request-workflow/1.0}requestDate = null
 {http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup = start_package_item_actions
 {http://www.mycompany.com/model/request-workflow/1.0}subjectMatter = 
 {http://www.alfresco.org/model/bpm/1.0}dueDate = null
 {http://www.alfresco.org/model/bpm/1.0}sendEMailNotifications = false
 {http://www.alfresco.org/model/bpm/1.0}completionDate = null
 {http://www.alfresco.org/model/bpm/1.0}description = Add information to request
 {http://www.alfresco.org/model/bpm/1.0}priority = 2
 {http://www.alfresco.org/model/bpm/1.0}status = Not Yet Started
 {http://www.alfresco.org/model/bpm/1.0}package = workspace://SpacesStore/2216f7ca-fabe-4337-a1c5-f9feea46ca08
 {http://www.alfresco.org/model/bpm/1.0}startDate = Thu Oct 20 13:58:28 KRAT 2016
 {http://www.alfresco.org/model/bpm/1.0}comment = 
 {http://www.alfresco.org/model/bpm/1.0}hiddenTransitions = 

Text state: IN_PROGRESS tells that task is not finished. So it should be assigned to someone, but I can not see any assined keyword (except reassignable = truereassignable = true).

Does it means that task is unassigned? How to determine user which was assigned to the task?

Upvotes: 2

Views: 936

Answers (1)

kinjelom
kinjelom

Reputation: 6450

This task is unassigned:

{http://www.alfresco.org/model/content/1.0}owner = null

The owner (cm:owner) property of a task indicates the current assignee.

https://community.alfresco.com/thread/186243-assignee-versus-owner

The owner of a task is the current assignee. The bpm:assignee property is actually for a task input by which the current assignee can set the assignee for the next task, i.e. when he has been assigned a task where he must decide who will be the next in line to process the workflow. As long as you don't include the bpm:assignee property or its aspect in your task model, you will never see it in your task properties at runtime.

You can reassign this task e.g. in JavaScript:

var task = workflow.getTask("activiti$99");
var props = task.getProperties();
props["cm:owner"] = "admin";
//props.owner = "admin";
task.setProperties(props);
logger.info(task.properties);

Upvotes: 3

Related Questions