-
1. Re: Need help in claiming the task
abhijithumbe Dec 11, 2015 8:17 AM (in response to sandeep.gollapudi)Hi,
You are facing this issue because you have disabled authentication for /rest end point. If you check source code you will see the action performed through REST API are done with the user that authenticated the REST call
~~~
@POST
@Path("/{taskId: [0-9-]+}/{oper: [a-zA-Z]+}")
public Response taskId_oper(@PathParam("taskId") long taskId, @PathParam("oper") String operation) {
Map<String, List<String>> params = getRequestParams(uriInfo);
operation = checkThatOperationExists(operation, allowedOperations);
String userId = identityProvider.getName();
logger.debug("Executing " + operation + " on task " + taskId + " by user " + userId );
~~~~
To work with REST API you have to enable authentication of /rest endpoint. If you use RemoteREST API it can solve your issue, here we can use different user for authentication and another for task operation, like as:
~~~~
RuntimeEngine engine = RemoteRuntimeEngineFactory.newRestBuilder().addUrl(url).addUserName(userName).addPassword(passWord)
.addDeploymentId(deploymentId).build();
TaskService taskService = engine.getTaskService();
taskService.start(1, "abhi");
taskService.complete(1, "abhi", null);
~~~~
Hope it helps..
-
2. Re: Need help in claiming the task
sandeep.gollapudi Dec 15, 2015 1:15 AM (in response to abhijithumbe)Very useful. Thanks you soo much Abhijit Humbe .
Regards,
Sandeep Gollapudi