cancel
Showing results for 
Search instead for 
Did you mean: 

Need API method call for following services in Activiti

viswa317
Champ in-the-making
Champ in-the-making
1, get all task assigned to a user

// its working.
 List<Task> tasks = taskService.createTaskQuery().taskAssignee(userId).list() 


2, get all task assigned to groups

//its task list empty, its not working
 List<Task> tasks =  taskService.createTaskQuery().taskCandidateGroupIn(roles).list() 


3, clam a task

//its working
 taskService.claim(taskId,springSecurityService.currentUser.id.toString()) 


4, revoke a task

// i don't know this is the right way
 taskService.claim(taskId,null) 


5, start process instance

//its working
 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(pdId, variables); 


6, complete a task

//its working
 taskService.complete(taskId,variables) 


7, get from properties for a task

// its not working.. its returning like [org.activiti.engine.impl.form.FormPropertyImpl@233e6b10, org.activiti.engine.impl.form.FormPropertyImpl@56e6f983]

 List<FormProperty> formList = formService.getTaskFormData(taskId).getFormProperties(); 


I want to make sure that i am doing in right way.. please correct if i am wrong
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
2.  Should work, we got tests for that. What is in 'roles' and what how does your assignment in your process looks like?
7. you probably want the variables not the properties. Use the getVariables method

The rest looks good to me.