cancel
Showing results for 
Search instead for 
Did you mean: 

Causing exception while claim a task

ccp999
Champ in-the-making
Champ in-the-making
Hi,

I'm new to Activiti.  I want to know in what situations that claim a task could lead to runtime exception.
I attached my process file.
I couldn't figure it out why it has the following error msg while I try to first claim the task of Edit KPI (5137):

org.activiti.engine.ActivitiTaskAlreadyClaimedException: Task '5137' is already claimed by someone else.
    at org.activiti.engine.impl.cmd.ClaimTaskCmd.execute(ClaimTaskCmd.java:41)
    at org.activiti.engine.impl.cmd.ClaimTaskCmd.execute(ClaimTaskCmd.java:23)
    at org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:59)
    at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
    at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
    at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
    at com.activiti.addon.cluster.interceptor.GatherMetricsCommandInterceptor.execute(GatherMetricsCommandInterceptor.java:57)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
    at org.activiti.engine.impl.TaskServiceImpl.claim(TaskServiceImpl.java:167)

I'm using Alfresco Enterprise 1.3.2.

Cheers,

CCP



3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
When your task already has an assignee, and you're calling the claim method, this exception will be thrown.

ccp999
Champ in-the-making
Champ in-the-making
The task is set to Process initiator and the user is the initiator.
The task doesn't show the form but only the claim button, so that the user have to click claim button and the exception shown in the console.
On the other hand , if a claimed or set assignee task should have the claim button activated.  It looks like it is a bug.

vasile_dirla
Star Contributor
Star Contributor
Hi,
since this process is designed to start automatically then there is no "process initiator" that's why I don't see any reason to assign the task to the process initiator.