Human tasks created using RemoteJmsRuntimeEngineFactory getting PermissionDeniedException on start and claim.
samboy_05 Jul 30, 2014 10:23 AMI am currently in the process of analyzing jBPM6.0.1 for our Orchestration needs. We are interested in the KIEWorkbench to centrally house , Deploy and Run our processes.
I have written a sample client to connect to KIE Workbench and run the process using both REST and JMS mechanisms .
The jbpm console jbpm-console-6.0.1.Final.war is deployed on an EAP 6.2 with standalone-full.xml .
The issue is that when a Process is started using a runtime obtained using RemoteJmsRuntimeEngineFactory , starting the human task in the process is resulting in the exception
Exception in thread "main" org.kie.services.client.api.command.RemoteRuntimeException: KieRemoteServicesRuntimeException thrown with message 'Unable to execute CompositeCommand because of PermissionDeniedException: User '[UserImpl:'krisv']' does not have permissions to execution operation 'Start' on task id 3' at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeJmsCommand(AbstractRemoteCommandObject.java:283) at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:112) at org.jbpm.services.task.impl.command.CommandBasedTaskService.start(CommandBasedTaskService.java:245)
Exception on the Server console running jbpm-console
19:13:22,741 INFO [org.jboss.as.naming] (Remoting "home-pc" task-2) JBAS011806: Channel end notification received, closing channel Channel ID 16afcdc9 (inbound) of Remoting connection 42de3587 to null 19:15:52,674 WARN [org.kie.services.remote.jms.RequestMessageBean] (Thread-12 (HornetQ-client-global-threads-26570831)) Unable to execute CompositeCommand because of PermissionDeniedException: User '[UserImpl:'krisv']' does not have permissions to execution operation 'Start' on task id 3: org.jbpm.services.task.exception.PermissionDeniedException: User '[UserImpl:'krisv']' does not have permissions to execution operation 'Start' on task id 3 at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.evalCommand(MVELLifeCycleManager.java:98) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:322) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.identity.UserGroupLifeCycleManagerDecorator.taskOperation(UserGroupLifeCycleManagerDecorator.java:46) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.impl.TaskInstanceServiceImpl.start(TaskInstanceServiceImpl.java:200) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.commands.StartTaskCommand.execute(StartTaskCommand.java:48) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.commands.StartTaskCommand.execute(StartTaskCommand.java:30) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:38) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.kie.services.remote.util.ExecuteAndSerializeCommand.execute(ExecuteAndSerializeCommand.java:24) [kie-services-remote-6.0.1.Final.jar:6.0.1.Final] at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.0.1.Final.jar:6.0.1.Final] at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:53) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.jbpm.services.task.impl.command.CommandBasedTaskService.execute(CommandBasedTaskService.java:128) [jbpm-human-task-core-6.0.1-20140120.jar:6.0.1-SNAPSHOT] at org.kie.services.remote.jms.RequestMessageBean.processJaxbCommandsRequest(RequestMessageBean.java:360) [kie-services-remote-6.0.1.Final.jar:6.0.1.Final] at org.kie.services.remote.jms.RequestMessageBean.onMessage(RequestMessageBean.java:194) [kie-services-remote-6.0.1.Final.jar:6.0.1.Final] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]
The code used to start the process looks like this :
public void runJbpmTest(){ Map<String ,Object> params= new HashMap<>(); params.put("decision", Boolean.TRUE); ProcessInstance pi = service.startBusinessProcess("jBPM6Poc.Compendium",params); // service object has both KIESession and TaskService and is used to expose their methods and maintain sanity //Thread.sleep(100); List<Long> taskIds =service.getActiveTasks(pi.getId()); if(taskIds!=null && taskIds.size()>0){ Task task = service.getTaskById(taskIds.get(0)); System.out.println("Process Instance id obtained:"+pi.getId()); Status status = task.getTaskData().getStatus(); if (status.name().equals("Created")) { service.claimTask(taskIds.get(0),"krisv"); service.startTask(taskIds.get(0),"krisv"); }else if(status.name().equals("Reserved")||status.name().equals("Ready")){ System.out.println("Starting Task : pid"+pi.getId()+" Task id:"+taskIds.get(0)); service.startTask(taskIds.get(0),"krisv"); } System.out.println("Completing Task : Task id:"+taskIds.get(0)); service.completeTask(taskIds.get(0), "krisv", params); } }
As you can see that the code is in accordance with the HumanTask Life cycle and I am attempting start only if the Satus is Ready , Which it is when line 17 is executing..
Looks to me that the method org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.isAllowed(OperationCommand, Task, User, List<String>) is returning false for some reason.
If I run the same code using KIESession and TaskService obtained using the REST client (RemoteRestRuntimeFactory) everything runs just fine !
The mechanism described in the documentation is used to connect to HornetQ
I am using stock users.properties and roles.properties for authentication . My standalone.xml for EAP6.2 is attached.
This is how my Process looks like:
salaboy21 can you help ? it is pretty urgent.
-
standalone.xml 21.0 KB