03-03-2014 03:52 PM
<textAnnotation id="versionNumber">
<text>1.2</text>
</textAnnotation>
@RequestMapping(value = "/artifactVersion", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<Object> getArtifactVersion(String key){
StringBuilder response = new StringBuilder();
try {
ProcessEngine processEngine = getProcessEngine(); //private method
RepositoryService repositoryService = processEngine.getRepositoryService();
String lastDeployedId = getLatestDeployedProcessId(key);
BpmnModel model = repositoryService.getBpmnModel(lastDeployedId);
TextAnnotation versionArtifact = (TextAnnotation) model.getArtifact("versionNumber");
response.append("Artifact version of bpmn file: " + versionArtifact.getText());
return new ResponseEntity<Object>(response.toString(), HttpStatus.OK);
} catch (Exception t) {
response.append(t);
return new ResponseEntity<Object>(response.toString(), HttpStatus.BAD_REQUEST);
} catch (Throwable t) {
response.append(t);
return new ResponseEntity<Object>(response.toString(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
03-10-2014 06:31 AM
03-10-2014 09:13 AM
06-06-2014 11:38 AM
06-17-2014 06:00 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.