Reputation: 1617
I am using jBPM 6.2.0. I have a small workflow containing a User Task. I am trying to complete the task using the remote API through a Java client.
Following is the code used.
TaskService taskService = connManager.getTaskService("admin", "admin");
taskService.start(4, "admin");
taskService.complete(4, "admin", null);
and the relavent methods.
private RemoteRuntimeEngine getRuntimeEngine(String deployment, String user,
String password) throws MalformedURLException {
URL deploymentUrl = new URL("http://localhost:8080/jbpm-console/");
return (RemoteRuntimeEngine) RemoteRuntimeEngineFactory
.newRestBuilder().addUrl(deploymentUrl).addUserName(user)
.addPassword(password).addDeploymentId("").build();
}
public TaskService getTaskService(String user, String password)
throws MalformedURLException {
// Establish Connection
RemoteRuntimeEngine conn = getRuntimeEngine("", user, password);
TaskService taskServcie = conn.getTaskService();
return taskServcie;
}
After I complete the task, the workflow is not moving forward. In my case, there are no activites later, so I am expecting the workflow to end.
Upvotes: 0
Views: 366
Reputation: 2918
You need to specify the correct deploymentId (rather than "") when completing the task. This means you can query the task list etc. without specifying a deploymentId, but to complete it, you need to use the right 'context'. The deploymentId can be retrieved from the task itself.
Note that we already did some improvements in master to make sure you can actually pass null or "" if you don't know the deploymentId upfront and you want us to look it up for you. But for 6.2.0.Final you will still need to look it up yourself.
Upvotes: 1