Not able to get variables for a process instance through Rest Remote API
bryan.johnson Apr 29, 2014 2:00 PMWhile I can start (and abort) a process instance following the documentation, I am unable to get the variables for a process.
I started with code borrowed from:
While the first post request to create the process instance works. The 2nd get request fails
@Test
public void restAnonymousTaskInitiator3Test() throws Exception {
ClientRequestFactory requestFactory;
requestFactory = RestRequestHelper.createRequestFactory(
"http://qepdv-app05.ams.int:8080/rest", userId, password,
10 * 1000);
// Create (start process) request
String urlString = new URL(deploymentUrl, deploymentUrl.getPath()
+ "rest/runtime/" + deploymentId + "/process/evaluation/start")
.toExternalForm();
urlString = urlString + "?map_employee=mary";
ClientRequest restRequest = requestFactory.createRequest(urlString);
logger.debug(">> " + urlString);
// Post, get response, check status response, and get info
ClientResponse<?> responseObj = checkResponse(restRequest.post());
JaxbProcessInstanceResponse processInstance = (JaxbProcessInstanceResponse) responseObj
.getEntity(JaxbProcessInstanceResponse.class);
long procInstId = processInstance.getId();
urlString = new URL(deploymentUrl, deploymentUrl.getPath()
+ "rest/runtime/" + deploymentId + "/process/instance/"
+ procInstId + "/variables").toExternalForm();
restRequest = requestFactory.createRequest(urlString);
logger.debug(">> " + urlString);
// Get, get response, check status response, and get info
responseObj = checkResponse(restRequest.get());
JaxbVariablesResponse response = (JaxbVariablesResponse) responseObj
.getEntity(JaxbVariablesResponse.class);
logger.debug("response obj >> " + response.toString());
}
Here is the relevant part of the logging:
<exception>
<status>NOT_FOUND</status>
<message>NotFoundException thrown with message 'Could not find resource for relative : /runtime/org.jbpm:Evaluation:1.0.2/process/instance/154/variables of full path: http://qepdv-app05.ams.int:8080/kie-wb/rest/runtime/org.jbpm:Evaluation:1.0.2/process/instance/154/variables'</message>
<stackTrace>org.jboss.resteasy.spi.NotFoundException: Could not find resource for relative : /runtime/org.jbpm:Evaluation:1.0.2/process/instance/154/variables of full path: http://qepdv-app05.ams.int:8080/kie-wb/rest/runtime/org.jbpm:Evaluation:1.0.2/process/instance/154/variables
I think that I am using the variables process call correctly
f I use the abort process call:
It works fine.
Any suggestions as to what I am doing wrong?
Thanks in advance.