01-09-2014 04:24 PM
public List<DiagramNode> getActivityCoordinates(String wfId) {
RuntimeService runtimeService = processEngine.getRuntimeService();
RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionEntity pi = (ExecutionEntty) processEngine.
getRuntimeService().createProcessInstanceQuery().
processInstanceId(wfId).singleResult();
ArrayList<DiagramNode> list = new ArrayList<DiagramNode>();
if (pi != null) {
DiagramLayout processDiagramLayout = repositoryService.
getProcessDiagramLayout(pi.getProcessDefinitionId());
List<String> activeActivityIds = runtimeService.getActiveActivityIds(pi.getId());
for (String activeActivityId : activeActivityIds) {
list.add(processDiagramLayout.getNode(activeActivityId));
}
}
return list;
}
protected DiagramNode getDiagramBoundsFromBpmnDi(Document bpmnModel) {
Double minX = null;
Double minY = null;
Double maxX = null;
Double maxY = null;
// Node positions and dimensions
NodeList setOfBounds = bpmnModel.getElementsByTagNameNS(BpmnParser.BPMN_DC_NS, "Bounds");
for (int i = 0; i < setOfBounds.getLength(); i++) {
Element element = (Element) setOfBounds.item(i);
Double x = Double.valueOf(element.getAttribute("x"));
Double y = Double.valueOf(element.getAttribute("y"));
Double width = Double.valueOf(element.getAttribute("width"));
Double height = Double.valueOf(element.getAttribute("height"));
if (x == 0.0 && y == 0.0 && width == 0.0 && height == 0.0) {
// Ignore empty labels like the ones produced by Yaoqiang:
// <bpmndi:BPMNLabel><dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/></bpmndi:BPMNLabel>
} else {
if (minX == null || x < minX) {
minX = x;
}
if (minY == null || y < minY) {
minY = y;
}
if (maxX == null || maxX < (x + width)) {
maxX = (x + width);
}
if (maxY == null || maxY < (y + height)) {
maxY = (y + height);
}
}
}
…
}
01-15-2014 10:09 AM
01-15-2014 10:19 AM
01-15-2014 01:08 PM
01-16-2014 03:38 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.