public class Bmpn2Img {
public static void main(String[] args) {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
RepositoryService repositoryService = processEngine.getRepositoryService();
TaskService taskService = processEngine.getTaskService();
ManagementService managementService = processEngine.getManagementService();
IdentityService identityService = processEngine.getIdentityService();
HistoryService historyService = processEngine.getHistoryService();
FormService formService = processEngine.getFormService();
Map<String, Object> variableMap = new HashMap<String, Object>();
ProcessInstance instance = runtimeService.startProcessInstanceByKey("MultitaskingProcess", variableMap);
File f = new File("processInstanceImage.png");
File f2 = new File("processDefintion.png");
FileOutputStream fos1 = null;
FileOutputStream fos2 = null;
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(instance.getProcessDefinitionId());
System.out.println("id" + instance.getId());
List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(instance.getId()).list();
List<String> activitiIds = runtimeService.getActiveActivityIds(instance.getId());
for (String s : activitiIds) {
System.out.println("s:" + s);
}
if (processDefinition != null&& processDefinition.isGraphicalNotationDefined()) {