1 Reply Latest reply on Jul 24, 2012 5:57 AM by swiderski.maciej

    How to add Human task Groups and Users in a spring configuration.

    milhaim

      Hi all,

       

      I m using jbpm 5.3 in a spring application, a part  of the config :

       

       

      ........  
      <bean id="taskService" class="org.jbpm.task.service.TaskService">
          <constructor-arg index="0" ref="htEMF"/>
          <constructor-arg index="1">
            <bean factory-method="getSystemEventListener" class="org.drools.SystemEventListenerFactory"/>
          </constructor-arg>
        </bean>
      
        <bean id="localTaskService" class="org.jbpm.task.service.local.LocalTaskService">
          <constructor-arg index="0" ref="taskService"/>
        </bean>
      
        <bean id="humanTaskHandler" class="org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler">
          <property name="client" ref="localTaskService"/>
        </bean>
      ..
      <drools:ksession id="ksession2" type="stateful" kbase="kbase2" node="node1">
          <drools:configuration>
            <drools:work-item-handlers>      
              <drools:work-item-handler  name="Human Task" ref="humanTaskHandler"/>
            </drools:work-item-handlers>
            <drools:jpa-persistence>
              <drools:transaction-manager ref="jbpmTxManager"/>
              <drools:entity-manager-factory ref="jbpmEMF"/>
            </drools:jpa-persistence>
          </drools:configuration>
        </drools:ksession>
      

       

      do any one know how to add the Users and Groups (taskSession.addUser( new User("Administrator")  );) etc ....

       

      thnaks,

        • 1. Re: How to add Human task Groups and Users in a spring configuration.
          swiderski.maciej

          Unfortunately I am not spring expert but I believe that should work:

          • create bean that is your UserGroupCallback implelemtation
          • create instance of UserGroupCallbackManager ( like factory with static method)
          • set callback filed of the manager with your custom usergroupcallback bean

           

          If that will not work, you could try just build your custom UserGroupCallback class that internally will get instance of the manager and register itself.

           

          HTH