-
1. Re: [Jbpm5]how to get the image showing the current status of a workflow
tsurdilovic Nov 27, 2011 12:57 AM (in response to aronjiao)Sorry for the late response on this question
The jBPM console overlays divs ontop of the image in order to display the red arrow icon next to active nodes in your process. Here is some sample code that does this:
String s =
"<div style='width:1024px; height:768px; background-color:#ffffff;'>" +
"<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;\">" +
"<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />";
for (ActiveNodeInfo activeNodeInfo: activeNodeInfos) {
s+= "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNodeInfo.getActiveNode().getY()-8) +"px;left:"+(activeNodeInfo.getActiveNode().getX()-8)+"px;width:50px;height:50px; z-index:1000;background-image: url(images/icons/play_red_big.png);background-repeat:no-repeat;\"></div>";
}
s+= "</div>" +
"</div>";
Hope this helps.
-
2. Re: [Jbpm5]how to get the image showing the current status of a workflow
aronjiao Nov 27, 2011 9:10 PM (in response to tsurdilovic)Thank you for your guidance! The sample code is very useful.
Using this code ,I can get the image showing the current status of a workflow.
But when I made my sample project, a new problem arose.
I must create the process's png file manually by tools such as eclipse plugins.
Is there any code showing the way to create a image automatically
maybe,
transfer a bpmn file to a png file
or get the image from a server?
-
3. Re: [Jbpm5]how to get the image showing the current status of a workflow
aronjiao Nov 27, 2011 9:12 PM (in response to tsurdilovic)Thank you for your guidance! The sample code is very useful.
Using this code ,I can get the image showing the current status of a workflow.
But when I made my sample project, a new problem arose.
I must create the process's png file manually by tools such as eclipse plugins.
Is there any code showing the way to create a image automatically
maybe,
transfer a bpmn file to a png file
or get the image from a server?
-
4. Re: [Jbpm5]how to get the image showing the current status of a workflow
tsurdilovic Nov 28, 2011 9:32 AM (in response to aronjiao)You would have to use the jBPM Eclipse tooling or the jBPM Web Designer to get to the initial image of your process. You could possibly write your own custom code for it, but I do not have anything useful (code examples) to give you for it.
-
5. Re: [Jbpm5]how to get the image showing the current status of a workflow
qintao1203 Nov 29, 2011 12:25 AM (in response to tsurdilovic)Thanks,I also need it.
-
7. Re: [Jbpm5]how to get the image showing the current status of a workflow
tsurdilovic Nov 29, 2011 6:21 AM (in response to aronjiao)Yes, in designer we can represent the process in the drawing canvas as SVG so designer uses apache batik to convert this SVG representation of your process to a png image.
Right now however you have to make the call from designer itself because it uses it's JS API to get to the SVG representation. I'll see what can be done and update this post soon.
-
8. Re: [Jbpm5]how to get the image showing the current status of a workflow
aronjiao Nov 29, 2011 8:51 PM (in response to tsurdilovic)It 's very kind of you.
-
9. Re: [Jbpm5]how to get the image showing the current status of a workflow
aronjiao Dec 9, 2011 8:47 AM (in response to tsurdilovic)Thank you for your helps!
Using org.apache.batik.transcoder.* , I can convert a svg file to a png file
To be honest , I don't know how to use the designer's js api into my application. It's difficult.
Is there any other java code can achieve it(bpmn-->svg)
If anyone knows,looking forward to your helps!
-
10. Re: [Jbpm5]how to get the image showing the current status of a workflow
gigazhang Apr 13, 2012 5:34 AM (in response to aronjiao)Is there any way ,some api, tranfer bpmn to png,or gif?
-
11. Re: [Jbpm5]how to get the image showing the current status of a workflow
mailamitjoshi Jul 24, 2012 4:37 AM (in response to tsurdilovic)Hi,
Many thanks for your reply. I am trying the solution mentioned by you but I end up with the following exception:
org.jbpm.api.JbpmException: resource jbpm.cfg.xml does not exist
at org.jbpm.pvm.internal.stream.ResourceStreamInput.openStream(ResourceStreamInput.java:60)
at org.jbpm.pvm.internal.xml.Parse.getInputSource(Parse.java:146)
at org.jbpm.pvm.internal.xml.Parser.buildDocument(Parser.java:453)
at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:425)
at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:158)
at org.jbpm.pvm.internal.cfg.ConfigurationImpl.parse(ConfigurationImpl.java:137)
at org.jbpm.pvm.internal.cfg.ConfigurationImpl.setResource(ConfigurationImpl.java:116)
at org.jbpm.pvm.internal.cfg.ConfigurationImpl.setResource(ConfigurationImpl.java:50)
at org.jbpm.api.Configuration.setResource(Configuration.java:79)
at org.jbpm.api.Configuration.getProcessEngine(Configuration.java:126)
Is the missing file required in jbpm 5? Any workaround?
Thanks and regards,
Amit
-
12. Re: [Jbpm5]how to get the image showing the current status of a workflow
mimi_2012 Oct 25, 2012 9:45 PM (in response to mailamitjoshi)can you tell me how to get the image showing the current status of a workflow? in this following codes:
String s =
"<div style='width:1024px; height:768px; background-color:#ffffff;'>" +
"<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;\">" +
"<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />";
for (ActiveNodeInfo activeNodeInfo: activeNodeInfos) {
s+= "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNodeInfo.getActiveNode().getY()-8) +"px;left:"+(activeNodeInfo.getActiveNode().getX()-8)+"px;width:50px;height:50px; z-index:1000;background-image: url(images/icons/play_red_big.png);background-repeat:no-repeat;\"></div>";
}
s+= "</div>" +
"</div>";
I don't know how to get ActiveNodeInfo which is defined in jbpm-console.var ,how to call it? thanks
-
13. Re: [Jbpm5]how to get the image showing the current status of a workflow
melc Oct 26, 2012 3:05 AM (in response to mimi_2012) -
14. Re: [Jbpm5]how to get the image showing the current status of a workflow
gulamnadim Feb 26, 2014 4:19 AM (in response to aronjiao)Hi
I want to display process Image on browser. So can any one guide me how to do that? Where the image is store and in which format?
Nadim