User null does not have permission to execute operation start on task...

330 views
Skip to first unread message

Tony Cattlin

unread,
Jun 14, 2017, 7:44:29 AM6/14/17
to jBPM Development
Hi,

- I am running JBPM 6.5 with "embedded" (Spring gets the (PerProcessInstance)RuntimeManager) for dev testing and "non embedded" (using RemoteRuntimeEngineFactory.newRestBuilder... ) when moving through the environments to Prod.
- session.startProcess(workflowIdentifier, parameters) works fine for both
- but taskService.start(taskId, "admin") is getting the following error when embedded (works fine for non embedded):

org.jbpm.services.task.exception.PermissionDeniedException: User 'null' does not have permissions to execute operation 'Start' on task id 1

at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.evalCommand(MVELLifeCycleManager.java:119)

at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:369)


This may be related to my null Session but a valid Runtime issue I was getting earlier (I never solved it, just worked around :-s).


- My code to get the Runtime for embedded and subsequently call the taskService.start is shown below

- The correct pid is being printed out when getting the runtime to "start"


Any ideas ?


cheers


Tony


    public RuntimeEngine getRuntimeEngine(Long pid) {
        runtimeManager = (PerProcessInstanceRuntimeManager)appContext.getBean("runtimeManager");

        RuntimeEngine engine;

        if (pid.equals(0L)) {
            engine = runtimeManager.getRuntimeEngine(ProcessInstanceIdContext.get());
        } else {
            System.out.println("getRuntimeEngine pid:" + pid);
            runtimeManager.getFactory().newKieSession();
            return runtimeManager.getRuntimeEngine(ProcessInstanceIdContext.get(pid));
        }
       
        return engine;
    }

...   

        RuntimeEngine engine = workflowRuntime.getRuntimeEngine(thePid));
        org.kie.api.task.TaskService taskService = engine.getTaskService();

        taskService.start(taskId, "admin") ; // PERMISSION DENIED EXCEPTION HERE



Tony Cattlin

unread,
Jun 14, 2017, 8:53:57 AM6/14/17
to jBPM Development
There was no 'admin' user in the organizationaEntity table so I have added it and the 'null' user has gone but I still get permission denied.

I somehow need to add the new admin user to the Administrators group. Working on it...

Tony Cattlin

unread,
Jun 14, 2017, 10:29:57 AM6/14/17
to jBPM Development
If anyone knows how to add a user and then make them part of the Administrator role, using the default Spring implementation it would be much appreciated because I am not having much luck (still getting permission denied for admin user (after adding manually to the organisationEntity table).

Thanks

Tony
Reply all
Reply to author
Forward
0 new messages