Description of problem: When I try to add an adhoc task remotely via AddTaskCommand, I get NPE: Caused by: java.lang.NullPointerException at org.jbpm.services.task.impl.model.xml.JaxbTaskData.getWorkItemId(JaxbTaskData.java:222) at org.jbpm.services.task.impl.model.xml.JaxbTask.getTask(JaxbTask.java:309) at org.jbpm.services.task.commands.AddTaskCommand.execute(AddTaskCommand.java:96) at org.jbpm.services.task.commands.AddTaskCommand.execute(AddTaskCommand.java:53) at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65) at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:54) at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40) at org.jbpm.services.task.impl.command.CommandBasedTaskService.execute(CommandBasedTaskService.java:128) at org.jbpm.kie.services.impl.UserTaskServiceImpl.execute(UserTaskServiceImpl.java:876) at org.jbpm.services.cdi.impl.UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.execute(UserTaskServiceCDIImpl$Proxy$_$$_WeldClientProxy.java) at org.kie.remote.services.cdi.ProcessRequestBean.doTaskOperation(ProcessRequestBean.java:232) The command requires to have workitemId, processInstanceId, ... configured though they are not necessary. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Kris, as far as I know, creation of ad-hoc tasks isn't yet a supported feature. Could you confirm or deny this?
It's a supported feature in the UI, so having that available in the remote API would be useful. If it's too difficult to do this through the remote API, we should at least make sure it does return a valid error message and document this.
That's interesting because in BPMS 6.0.x the command worked and it is in the list of supported commands here https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.0/html-single/Development_Guide/index.html#Execute_calls The reproducer I mentioned in the previous comment was created for BZ 1069174.
fixed by ensuring null primitive wrappers are not cast to primitives (Long(null) -> long) for JaxbTaskData jbpm master: https://github.com/droolsjbpm/jbpm/commit/0807d631377606fb13c916887f8f6944ede28eda 6.2.x: https://github.com/droolsjbpm/jbpm/commit/f66226d1a27e758bcd0fcff1898bfe3b5d03582b
Verified in BPMS 6.1.0.ER5