This content has been marked as final.
Show 5 replies
-
1. Re: How to get process jpg and gpd
cahimoped May 31, 2007 11:45 AM (in response to lachelt)Found it in the old webapp code :
processDefinition.getFileDefinition().getBytes("processimage.jpg")
And you can get the ProcessDefinition from GraphSession. -
2. Re: How to get process jpg and gpd
lachelt May 31, 2007 11:58 AM (in response to lachelt)Ah, that helps me understand the FileDefinition class.
Thanks for the quick and simple reply. -
3. Re: How to get process jpg and gpd
olivier.ch Nov 8, 2007 8:47 AM (in response to lachelt)I have tryed your solution but when I get the FileDefinition, this object is null...
Is there something to do when you deploy your process to be able to get this image ... ?
my code to get this FileDefinition is :JbpmContext context = Jbpmconfiguration.createJbpmContext(); ProcessInstance pi = context.loadProcessInstance(idProcess); ProcessDefinition processDefinition = context.getGraphSession().loadProcessDefinition(pi.getProcessDefinition().getId()); FileDefinition fileDefinition = processDefinition.getFileDefinition(); byte[] bytes = fileDefinition.getBytes("processimage.jpg");
I get a nullPointerException on the last line, of course my fileDefinition is null ... why ? -
4. Re: How to get process jpg and gpd
heinerniehues Nov 8, 2007 2:29 PM (in response to lachelt)Hi
Did you before upload the processimage.jpg and the gpd.xml ?
This is necessery because the ProcessDefinition.xml doesnt contain this files.
You have to add these files to the processdefinition like this:ProcessDefinition pi = jbpmContext.getGraphSession().loadProcessDefinition(pid); FileDefinition fileDefinition = pi.getFileDefinition(); if (fileDefinition == null) { fileDefinition = new FileDefinition(); pi.addDefinition(fileDefinition); } fileDefinition.addFile(name, inputStream); jbpmContext.getGraphSession().saveProcessDefinition(pi);
-
5. Re: How to get process jpg and gpd
olivier.ch Nov 9, 2007 8:36 AM (in response to lachelt)Perfect it works ... thanks a lot ...
Olivier