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-22-2011 04:35 AM
ReadOnlyProcessDefinition def = ((RepositoryServiceImpl)repoService).getDeployedProcessDefinition(processDefinitionId);
02-22-2011 04:37 AM
02-22-2011 07:08 AM
The ProcessDefinition returned by the query had no ActivityImpl initialized, use this (not exposed on public API) instead:
ReadOnlyProcessDefinition def = ((RepositoryServiceImpl)repoService).getDeployedProcessDefinition(processDefinitionId);
02-22-2011 07:17 AM
// Graphical information
protected int x = -1;
protected int y = -1;
protected int width = -1;
protected int height = -1;
02-22-2011 08:30 AM
02-24-2011 04:38 AM
These values are filled in during parsing, IF your process has Diagram interchange information (eg. when using Activiti Modeler or Designer)
02-24-2011 05:22 AM
02-24-2011 07:29 AM
In case no image is provided in the deployment, as described in the previous section, the Activiti engine will generate a diagram image when the process definition contains the necessary 'diagram interchange' information. This is the case when using the Activiti Modeler (and in the near future when using the Activiti Eclipse Designer).
02-25-2011 04:46 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.