JBoss Community

Re: Create Custom Implementation for Human Task WorkItemHandler, Which class I should extend?

created by Timothy Charman in jBPM - View the full discussion

default.session.template is in console-server code in src/main/resources.  It looks like this:

new SessionTemplate().{ 

    businessKey = "jbpm/consolesession",

    imported = false,

    persistenceUnit = "org.jbpm.persistence.jpa",

   

    properties = ["drools.processInstanceManagerFactory":"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory",

                  "drools.processSignalManagerFactory" : "org.jbpm.persistence.processinstance.JPASignalManagerFactory" 

                    ],

                   

    workItemHandlers = ["Human Task" : "new org.jbpm.process.workitem.wsht.AsyncHornetQHTWorkItemHandler(\"jbpmConsoleHTHandler\", taskClient, ksession, org.jbpm.task.utils.OnErrorAction.LOG)",

                        "Service Task" : "new org.jbpm.process.workitem.bpmn2.ServiceTaskHandler(ksession)"],

                       

    eventListeners = ["new org.jbpm.process.audit.JPAWorkingMemoryDbLogger(ksession)",

                      "new org.jbpm.integration.console.listeners.TriggerRulesEventListener(ksession)"  ]

};

 

You won't find a session.template unless you create one to override this.

 

The session template is loaded by the MVELSingleSessionManager.  The code is like this:

            InputStream templateFile = PropertyLoader.getStreamForConfigFile("/session.template", defaultSessionTemplate);

 

So it loads the property from the classpath - you just have to pick a place on the classpath :) .

 

We gave up with this approach as we have dozens of human type tasks and didn't want to configure them all here, and we wrote our own SessionManager, but it is up to you.

Reply to this message by going to Community

Start a new discussion in jBPM at Community