cancel
Showing results for 
Search instead for 
Did you mean: 

How to claim a task Correctly

raveera
Champ in-the-making
Champ in-the-making
I have a problem of claiming task.I already went through user guide but couldn't find any solution.I doubted i took wrong approach

taskService = processEngine.getTaskService();
taskService.claim("13260", "kermit");

exception

HTTP Status 500 - Request processing failed; nested exception is org.activiti.engine.ActivitiIllegalArgumentException: unknown type 'user' approver

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.activiti.engine.ActivitiIllegalArgumentException: unknown type 'user' approver
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause

org.activiti.engine.ActivitiIllegalArgumentException: unknown type 'user' approver
   org.activiti.engine.impl.form.FormTypes.parseFormPropertyType(FormTypes.java:55)
   org.activiti.engine.impl.form.DefaultFormHandler.parseConfiguration(DefaultFormHandler.java:61)
   org.activiti.engine.impl.form.DefaultStartFormHandler.parseConfiguration(DefaultStartFormHandler.java:34)
   org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.createStartFormHandlers(StartEventParseHandler.java:84)
   org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.executeParse(StartEventParseHandler.java:58)
   org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.executeParse(StartEventParseHandler.java:38)
   org.activiti.engine.impl.bpmn.parser.handler.AbstractBpmnParseHandler.parse(AbstractBpmnParseHandler.java:84)
   org.activiti.engine.impl.bpmn.parser.handler.AbstractFlowNodeBpmnParseHandler.parse(AbstractFlowNodeBpmnParseHandler.java:27)
   org.activiti.engine.impl.bpmn.parser.handler.AbstractActivityBpmnParseHandler.parse(AbstractActivityBpmnParseHandler.java:36)
   org.activiti.engine.impl.bpmn.parser.BpmnParseHandlers.parseElement(BpmnParseHandlers.java:73)
   org.activiti.engine.impl.bpmn.parser.BpmnParse.processFlowElements(BpmnParse.java:435)
   org.activiti.engine.impl.bpmn.parser.handler.ProcessParseHandler.transformProcess(ProcessParseHandler.java:88)
   org.activiti.engine.impl.bpmn.parser.handler.ProcessParseHandler.executeParse(ProcessParseHandler.java:49)
   org.activiti.engine.impl.bpmn.parser.handler.ProcessParseHandler.executeParse(ProcessParseHandler.java:35)
   org.activiti.engine.impl.bpmn.parser.handler.AbstractBpmnParseHandler.parse(AbstractBpmnParseHandler.java:84)
   org.activiti.engine.impl.bpmn.parser.BpmnParseHandlers.parseElement(BpmnParseHandlers.java:73)
   org.activiti.engine.impl.bpmn.parser.BpmnParse.transformProcessDefinitions(BpmnParse.java:395)
   org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:231)
   org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:107)
   org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:50)
   org.activiti.engine.impl.persistence.deploy.DeploymentManager.resolveProcessDefinition(DeploymentManager.java:115)
   org.activiti.engine.impl.persistence.deploy.DeploymentManager.findDeployedProcessDefinitionById(DeploymentManager.java:65)
   org.activiti.engine.impl.persistence.entity.TaskEntity.getTaskDefinition(TaskEntity.java:751)
   org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:711)
   org.activiti.engine.impl.persistence.entity.TaskEntity.setAssignee(TaskEntity.java:561)
   org.activiti.engine.impl.cmd.ClaimTaskCmd.execute(ClaimTaskCmd.java:44)
   org.activiti.engine.impl.cmd.ClaimTaskCmd.execute(ClaimTaskCmd.java:23)
   org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:61)
   org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
   org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
   org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
   org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
   org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   org.activiti.engine.impl.TaskServiceImpl.claim(TaskServiceImpl.java:158)
   com.auradot.controller.TaskController.claimTask(TaskController.java:166)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   java.lang.reflect.Method.invoke(Method.java:601)
   org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
   org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
   org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
   org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
   org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
   org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


Why this is happening. I used different users and different tasks but the same problem occurred.It will be very helpful if you provide any solution and guidelines for these.
Also i have some confusion about these three methods.What are the differences about these three

setAssignee(String taskId,String userId)
setOwner(String taskId,String userId)
claim(String taskId,String userId)
2 REPLIES 2

sathish1
Champ in-the-making
Champ in-the-making
<blockcode>
org.activiti.engine.ActivitiIllegalArgumentException: unknown type 'user' approver
</blockcode>

Looks like u have a wrong property in the FormType. Activiti OOTB supports only
<code>

We support the following form property types:

string (org.activiti.engine.impl.form.StringFormType)
long (org.activiti.engine.impl.form.LongFormType)
enum (org.activiti.engine.impl.form.EnumFormType)
date (org.activiti.engine.impl.form.DateFormType)
boolean (org.activiti.engine.impl.form.BooleanFormType)
</code>

setAssignee is used to set the person who is currently assigned the task.
setOwner is the method used to set the actual owner of the task, so for example after an assignee is done with his part of the task, it will goto the owner of the task.
Finally claim is used when suppose ur in a group that has 5 users and 1 of the user wants to get the task assigned to him then he/she can claim that task.

Cheers

raveera
Champ in-the-making
Champ in-the-making
thanks I will look at it