麻烦 Bonita 和 Java

Troubles Bonita and Java

当我尝试从 Eclipse 使用 Bonita 中的任务时,出现此错误:

POST http://localhost:8080/bonita/serverAPI/org.bonitasoft.engine.api.ProcessAPI/updateActivityInstanceVariables HTTP/1.1

2019-05-23 16:47:01,406 ERROR c.e.b.s.BPMService:206 - Exception org.bonitasoft.engine.exception.UpdateException: USERNAME=usuario | Some data does not exists, wanted to update [param1, param2] but there is only [] at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:128) at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:86) at com.sun.proxy.$Proxy6.updateActivityInstanceVariables(Unknown Source) at com.example.bonita.service.BPMServiceImpl.updateProcess(BPMServiceImpl.java:144) at com.example.bonita.service.BPMServiceImpl.executeBPMTask(BPMServiceImpl.java:221)

我的代码是这样的:

boolean resolved = false;
String result = "";

APISession apisession = bpmService.createLogin(username, password);

pendingTasks.clear();
pendingTasks = processAPI.getPendingHumanTaskInstances(apiSession.getUserId(), 0, 30, null);

for (Iterator<HumanTaskInstance> i = pendingTasks.iterator(); i.hasNext();) {
    HumanTaskInstance item = i.next();
    if (item.getRootContainerId() == request.getInstanceId()) {
        taskid = item.getId();
        processAPI.updateActivityInstanceVariables(taskid, request.getVariables());

        resolved = true;
        break;
    }
}

我在 Maven 中的 Bonita 版本是 7.8.4,我使用的是 Eclipse。

你知道我忘记了什么吗?

谢谢

我通过将方法 updateActivityInstanceVariables 替换为 executeUserTask(userId, taskid, listVariablesSerializable) 解决了这个问题。