-
1. Re: [Jbpm5]how to get the image showing the current status of a workflow in the web application
eaa Oct 8, 2012 3:27 AM (in response to mimi_2012)If you are using the svg file generated by web-desiger, then you could use this library: https://github.com/esteban-aliverti/jBPM-Process-Image-Processor
-
2. Re: [Jbpm5]how to get the image showing the current status of a workflow in the web application
mimi_2012 Oct 8, 2012 3:55 AM (in response to eaa)thank you,but I use the bpmn file ,in JBPM4.4 it is simple to achieve this function:
<%@page import="org.jbpm.api.*,java.io.*"%>
<%
ProcessEngine processEngine = Configuration.getProcessEngine();
RepositoryService repositoryService = processEngine
.getRepositoryService();
ExecutionService executionService = processEngine
.getExecutionService();
String id = request.getParameter("id");
ProcessInstance processInstance = executionService
.findProcessInstanceById(id);
String processDefinitionId = processInstance
.getProcessDefinitionId();
ProcessDefinition processDefinition = repositoryService
.createProcessDefinitionQuery().processDefinitionId(
processDefinitionId).uniqueResult();
InputStream inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),"loan.png");
byte[] b = new byte[1024];
int len = -1;
while ((len = inputStream.read(b, 0, 1024)) != -1) {
response.getOutputStream().write(b, 0, len);
}
%><%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="org.jbpm.api.*,java.util.*,org.jbpm.api.model.*" %>
<%
String id = request.getParameter("id");
ProcessEngine processEngine = Configuration.getProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionService executionService = processEngine.getExecutionService();
ProcessInstance processInstance = executionService.findProcessInstanceById(id);
Set<String> activityNames = processInstance.findActiveActivityNames();
ActivityCoordinates ac = repositoryService.getActivityCoordinates(processInstance.getProcessDefinitionId(),activityNames.iterator().next());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<img src="loan.png" style="position:absolute;left:0px;top:0px;">
<div style="position:absolute;border:1px solid red;left:<%=ac.getX()%>px;top:<%=ac.getY()%>px;width:<%=ac.getWidth()%>px;height:<%=ac.getHeight()%>px;"></div>
</body>
</html> -
3. Re: [Jbpm5]how to get the image showing the current status of a workflow in the web application
yogesh02 Nov 20, 2013 1:15 AM (in response to mimi_2012)Hi sariner marry,
Did you get any success on this??
I too have same requirement for developing that, Please Help...Thanks in advance
Regards
Yogesh
-
4. Re: [Jbpm5]how to get the image showing the current status of a workflow in the web application
arronlee Nov 20, 2013 10:42 PM (in response to mimi_2012)Hi, Marry.
I can not understand your question very clearly. You want to get the image showing the current status of a workflow in the web application? I wonder whether it can be accomplished by creating a web image viewer? I am not sosure about it. But I hope you success. Good luck.
Best regards,
Arron
-
5. Re: [Jbpm5]how to get the image showing the current status of a workflow in the web application
quangtin3 Nov 21, 2013 2:06 AM (in response to mimi_2012)Hi Sariner Marry,
Maybe in jBPM 5, the similary code that you're looking for is in bpm-console, a subproject of jbpm. It's a gwt client side code: ActivityDiagramView.java
In our case, we're using jbpm-5.4.Final as an embedded engine so we had to reimplement process activity history diagram. It helped us to put more domain specific details on the diagram as a side effect.
In that reimplementation process, an article by Branislav Cavlin was very helpfull: Display jBPM diagram of the current process.
Hope this helps.