}
ProcessEngineConfiguration processEngineConfig = ((ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine()).getProcessEngineConfiguration();
ProcessDiagramGenerator diagramGenerator = processEngineConfig.getProcessDiagramGenerator();
StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
.buildStreamResource(processInstance.getId(), processInstance.getProcessDefinitionId(),
repositoryService, runtimeService, diagramGenerator, processEngineConfig);
currentEmbedded = new Embedded(null, diagram);
currentEmbedded.setType(Embedded.TYPE_IMAGE);