hi,
I want to user JMSTaskServer as transporter between JBPM 5.4 process engine and TaskClient.
Serever is initilized as:
Properties serverProperties = new Properties();
serverProperties.setProperty("JMSTaskServer.connectionFactory", "ConnectionFactory");
serverProperties.setProperty("JMSTaskServer.transacted", "true");
serverProperties.setProperty("JMSTaskServer.acknowledgeMode", "AUTO_ACKNOWLEDGE");
serverProperties.setProperty("JMSTaskServer.queueName", "tasksQueue");
serverProperties.setProperty("JMSTaskServer.responseQueueName", "tasksResponseQueue");
try {
this.server = new JMSTaskServer(taskService, serverProperties, new InitialContext());
} catch (NamingException e1) {
e1.printStackTrace();
}
thread = new Thread(server);
thread.start();
The Task client for JMS is as :
public static TaskService getTaskClient() {
Properties clientProperties = new Properties();
clientProperties.setProperty("JMSTaskClient.connectionFactory", "ConnectionFactory");
clientProperties.setProperty("JMSTaskClient.transactedQueue", "true");
clientProperties.setProperty("JMSTaskClient.acknowledgeMode", "AUTO_ACKNOWLEDGE");
clientProperties.setProperty("JMSTaskClient.queueName", "tasksQueue");
clientProperties.setProperty("JMSTaskClient.responseQueueName", "tasksResponseQueue");
TaskService client = null;
try {
client = new SyncTaskServiceWrapper(new TaskClient(new JMSTaskClientConnector( UUID.randomUUID().toString() + "WSThroughJMSHumanTaskHandler" , new JMSTaskClientHandler(
SystemEventListenerFactory.getSystemEventListener()), clientProperties, new InitialContext())));
} catch (NamingException e) {
e.printStackTrace();
}
return client;
}
When I do the TaskSummary look up it works fine.
But when i start the new process instance which having human task it fails.
so which human task work item handler need to use.
I have tried below but does not work
CommandBasedHornetQWSHumanTaskHandler wsHumanTaskHandler = new CommandBasedHornetQWSHumanTaskHandler(knowledgeSession);
wsHumanTaskHandler.setClient(getTaskClientInstance());
wsHumanTaskHandler.setConnection("127.0.0.1", 5445);
knowledgeSession.getWorkItemManager().registerWorkItemHandler("Human Task", wsHumanTaskHandler);
This is CommandBasedHornetQWSHumanTaskHandler deprecated class but I have no clue which one need use.
It is giving following error :
Caused by: java.lang.RuntimeException: Error creating message
at org.jbpm.task.service.jms.JMSTaskClientConnector.write(JMSTaskClientConnector.java:152) [jbpm-human-task-jms-5.4.0.Final.jar:5.4.0.Final]
at org.jbpm.task.service.TaskClient.registerForEvent(TaskClient.java:623) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]
at org.jbpm.task.service.hornetq.CommandBasedHornetQWSHumanTaskHandler.connect(CommandBasedHornetQWSHumanTaskHandler.java:103) [jbpm-human-tas
k-hornetq-5.4.0.Final.jar:5.4.0.Final]
at org.jbpm.task.service.hornetq.CommandBasedHornetQWSHumanTaskHandler.executeWorkItem(CommandBasedHornetQWSHumanTaskHandler.java:111) [jbpm-h
uman-task-hornetq-5.4.0.Final.jar:5.4.0.Final]
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:55) [drools-persistence-jpa-5
.5.0.Final.jar:5.5.0.Final]
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]
... 42 more
Caused by: java.lang.NullPointerException
at org.jbpm.task.service.jms.JMSTaskClientConnector.write(JMSTaskClientConnector.java:126) [jbpm-human-task-jms-5.4.0.Final.jar:5.4.0.Final]
... 48 more
Please help me ....
Thanks & regards,
-vinayak