Red Hat Bugzilla – Bug 1025389
Start and complete commands of a task in one JMS request produces NPE
Last modified: 2016-09-20 01:05:11 EDT
Created attachment 817960 [details]
Description of problem:
When you send a JMS request containing two commands to start and complete a task, the NPE is thrown on the server side and the task is not completed.
This is the way how to create a single JMS request containing start and complete task commands:
cmd = new StartTaskCommand(taskId, SALA_USER);
req = new JaxbCommandsRequest(deploymentId, cmd);
req.getCommands().add(new CompleteTaskCommand(taskId, SALA_USER, null));
response = sendJmsJaxbCommandsRequest(TASK_QUEUE_NAME, req, user, password);
The whole reproducer is here https://github.com/droolsjbpm/kie-tests/blob/6.0.x/kie-wb-tests/kie-wb-tests-base/src/main/java/org/kie/tests/wb/base/methods/JmsIntegrationTestMethods.java#L110
One important fact about human-task that came to light when researching this issue is that multiple human-task commands can not be execute within the same request scope. This means that clients will have to hack around using human-task in an EE environment when they do more than one human-task operation in a EJB or MDB.
The above issue is thus *NOT* an issue for the JMS or REST api, because we repeatedly inject a new em for every command and call em.joinTransaction().
Verified in BPMS 6.0.0.ER5