I'm new to jBPM and I'm developing a ESB service to allow a web application to manage processes and tasks.
I'm using jBPM 5.4 deployed in my own JBOSS AS 7.1.1 and persisting in postgres.
The process is deployed in Guvnor and it all works fine, persistance is working and I can do all the required operations via my ESB.
The problem is that I was using AsyncHornetQHTWorkItemHandler as work item handler and the tasks would'nt move forward when the previous was completed.
Then I changed the handler to CommandBasedHornetQWSHumanTaskHandler and it works fine, the problem is that class is deprecated so I should'nt use it and I can't find an alternative for that.
I have a workflow of this type:
Start ---> Human Task ---> Script Task ---> Human Task ---> Human Task ---> Human Task ---> End
This is the code I'm using, note that this is working fine but using the deprecated class:
KnowledgeBase kbase = null;
StatefulKnowledgeSession ksession = null;
EntityManagerFactory emf = Persistence.createEntityManagerFactory( PERSISTANCE_ENTITY_NAME );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
kbase = readKnowledgeBase();
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
CommandBasedHornetQWSHumanTaskHandler humanTaskHandler = new CommandBasedHornetQWSHumanTaskHandler(ksession);
As this is a big project I should'nt use a deprecated class, can you help me on this?
Instead of last 2 lines of your code, u can use this :
HornetQHTWorkItemHandler taskHandler = new HornetQHTWorkItemHandler(ksession); taskHandler.setIpAddress(ipAddress); taskHandler.setPort(port);