Search code examples
jbossjbpmbpmn

PermissionDeniedException: User '[UserImpl:'admin']' was unable to execution operation 'Start' on task id 1 due to a no 'current status' match


I'm working on jBPM6 and jboss6.2 and trying to create an application with different levels like Employee, Lead and Director. Lead and Director are Groups. After creating process, I just as an Employee sent a some request and process moved to Lead, He has approved the request and process moved to Director, Once he is trying to approve it is throwing the following error.

[org.jbpm.services.task.persistence.TaskTransactionInterceptor] (http-localhost/127.0.0.1:8080-5) Could not commit session: org.jbpm.services.task.exception.PermissionDeniedException: User '[UserImpl:'admin']' was unable to execution operation 'Start' on task id 1 due to a no 'current status' match
at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.evalCommand(MVELLifeCycleManager.java:128) [jbpm-human-task-core-6.0.1.Final.jar:6.0.1.Final]
at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:318) [jbpm-human-task-core-6.0.1.Final.jar:6.0.1.Final]
at org.jbpm.services.task.identity.UserGroupLifeCycleManagerDecorator.taskOperation(UserGroupLifeCycleManagerDecorator.java:46) [jbpm-human-task-core-6.0.1.Final.jar:6.0.1.Final]  

while executing the following piece of code:

    TaskService taskService = runtimeEngine.getTaskService();
    taskService.start(taskId, username);
    taskService.complete(taskId, username, parameterMap);

I'm new to BPM process flow, but tried my best to fix the problem. But didn't find solution for it. Please advise me how to solve it ? where it is going wrong like configuration or anything else ?
Thanks,
Mr.Chowdary


Solution

  • After putting lot of efforts, debugging the code, i came to know that in operations-dsl.mvel file in jbpm-human-task-core-6.0.1.Final.jar having operations like Start,Complete,Fail,Exit and etc. In that the current status is not defined. It is happeneing due to some errors while completing the task. Eg:

    taskService.start(taskId, username);   
    

    Before this step, the status is "Ready"
    After executing this step, the status will be "InProgress"

    taskService.complete(taskId, username, parameterMap);  
    

    While executing complete(), if any exception cause, then the status will be "InProgress" only
    So if user tries to complete the task, it will start with start() method, in that method status "InProgress" is not defined. So it throws the following exception.

    [org.jbpm.services.task.persistence.TaskTransactionInterceptor] (http-localhost/127.0.0.1:8080-5) Could not commit session: org.jbpm.services.task.exception.PermissionDeniedException: User '[UserImpl:'admin']' was unable to execution operation 'Start' on task id 1 due to a no 'current status' match