Created
November 29, 2011 07:20
-
-
Save henryyan/1403844 to your computer and use it in GitHub Desktop.
获取节点坐标
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例 | |
Object property = PropertyUtils.getProperty(execution, "activityId"); | |
String activityId = ""; | |
if (property != null) { | |
activityId = property.toString(); | |
} | |
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); | |
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) | |
.getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); | |
List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点 | |
ActivityImpl activity = null; | |
for (ActivityImpl activityImpl : activitiList) { | |
String id = activityImpl.getId(); | |
if (id.equals(activityId)) {//获得执行到那个节点 | |
activity = activityImpl; | |
break; | |
} | |
} | |
Map<String, Integer> activityImageInfo = new HashMap<String, Integer>(); | |
activityImageInfo.put("x", activity.getX()); | |
activityImageInfo.put("y", activity.getY()); | |
activityImageInfo.put("width", activity.getWidth()); | |
activityImageInfo.put("height", activity.getHeight()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment