02-22-2011 04:26 AM
// get ID from jsp page
String id = ActionUtil.getParameter("piId");
ProcessEngine pe = Configuration.getProcessEngine();
RepositoryService ps = pe.getRepositoryService();
ExecutionService es = pe.getExecutionService();
// query the process instance
ProcessInstance pi = es.createProcessInstanceQuery().processInstanceId(id).uniqueResult();
String pdId = pi.getProcessDefinitionId();
Set<String> names = pi.findActiveActivityNames();
// get the coordinate of acitivity
ActivityCoordinates ac = ps.getActivityCoordinates(pdId,names.iterator().next());
System.out.println(ac.getX() +"\t" +ac.getY());
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("leave2")
.list()
.get(0);
ProcessDefinitionImpl pdImpl = (ProcessDefinitionImpl) processDefinition;
/**
* ??? ProcessDefinitionImpl.getInitial is null
*/
ActivityImpl actImpl = pdImpl.getInitial();
System.out.println(actImpl.getX() +"\t" +actImpl.getY());
ExecutionEntity execution = (ExecutionEntity) runtimeService.createExecutionQuery()
.executionId("101")
.singleResult();
/**
* ??? execution.getActivity() is null
*/
actImpl = execution.getActivity();
System.out.println(actImpl.getX() +"\t" +actImpl.getY());
02-25-2011 07:48 AM
Which version are you using? DI information was added in the last (5.2) release.
Could you please upload your process so we can take a look?
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.