how to use localtaskservice

Version 1

    i have a question about local taskservice.


    will auto create human task info that in process to  database when i start a process?


    Whether you can use jpa transaction manager?


    In my test, i use jpa transaction.


    Local Process session

    local task server

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="" xmlns:xsi=""
        <bean id="systemEventListener" class="org.drools.SystemEventListenerFactory" factory-method="getSystemEventListener" />
        <bean id="internalTaskService" class="org.jbpm.task.service.TaskService">
            <property name="systemEventListener" ref="systemEventListener" />
        <bean id="htTxManager" class="org.drools.container.spring.beans.persistence.HumanTaskSpringTransactionManager">
            <constructor-arg ref="transactionManagerTask" />
        <bean id="springTaskSessionFactory" class="org.jbpm.task.service.persistence.TaskSessionSpringFactoryImpl" init-method="initialize"
            <property name="entityManagerFactory" ref="taskEmf" />
            <property name="transactionManager" ref="htTxManager" />
            <property name="useJTA" value="false" />
            <property name="taskService" ref="internalTaskService" />
        <bean id="taskService" class="org.jbpm.task.service.local.LocalTaskService" depends-on="springTaskSessionFactory">
            <constructor-arg ref="internalTaskService" />



    Unit Test



        public void testHumanTask() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("employee", "a_alter");
        LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(service, session);
        session.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);
        session.startProcess("com.sample.evaluation", map);


    i find in startProcess, the human task will open a single session and ltaskservicesession addtask will not commit immidate, but the entitymanagerholder is shared.


    at the last it will excute DroolsSpringTransactionManager commit; but the the session about humantask will not commit;


    why? I  must need use JTA?




    there is another question,  I'm not find how to working about Humantask'  workitemhandler. 


    where i can find it?