AnsweredAssumed Answered

Track the process like JBPM4

Question asked by weiyi2011 on Feb 22, 2011
Latest reply on Feb 25, 2011 by weiyi2011
Hi, everybody.

I want to track the process like JBPM4.


// 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());

Activiti5:[something I try]   :cry:

ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
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()

* ??? execution.getActivity() is null
actImpl = execution.getActivity();
System.out.println(actImpl.getX() +"\t" +actImpl.getY());

Can you show me the way? Thanks very much.