bpmn - jBPM 6.2 How to add an user that can execute all tasks? -


in jbpm 6.2, can assign user task either actor or group such potential owners of these tasks. there user can define in code or bpmn file can execute user tasks regardless of fact task assigned him or not?

create user username "administrator", or use 1 of existing users , add group "administrators". gives user(s) in question access task businessadministrator. should work of requirements.

if experience challenges approach, option implement own custom task assignment behaviour in 'human task' workitemhandler, let's first try approach mentioned above.

as requested code example of approach be:

  1. implement class test.customhtworkitemhandler extends localhtworkitemhandler (https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-workitems/src/main/java/org/jbpm/services/task/wih/localhtworkitemhandler.java).
  2. give new consuctor: public customhtworkitemhandler(runtimemanager runtimemanager){ super.setruntimemanager(runtimemanager); }
  3. override method createtaskbasedonworkitemparams: protected task createtaskbasedonworkitemparams(kiesession session, workitem workitem) { internaltask task =(internaltask)super.createtaskbasedonworkitemparams(session,workitem); group admingroup = taskmodelprovider.getfactory().newgroup(); ((internalorganizationalentity) admingroup).setid("myspecialadmingroup");
    task.getpeopleassignments().getbusinessadministrators().add(admingroup); return task; }
  4. in deployment descriptor xml file, register new customhtworkitemhandler:

<work-item-handler> <resolver>mvel</resolver> <identifier>new test.customhtworkitemhandler(runtimemanager)</identifier> <name>human task</name> </work-item-handler>


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -