[
https://jira.jboss.org/jira/browse/JBPM-2269?page=com.atlassian.jira.plug...
]
Tom Baeyens resolved JBPM-2269.
-------------------------------
Resolution: Done
I've implemented it differently. I've added a method getImageResourceName() to
ProcessDefinition. Since ProcessDefinition already had the method getDeploymentDbid(),
images can now be obtained like this:
InputStream inputStream =
repositoryService.getResourceAsStream(processDefinition.getDeploymentDbid(),
processDefinition.getImageResourceName());
Full test case:
long deploymentDbid = repositoryService
.createDeployment()
.addResourceFromClasspath("org/jbpm/test/deploy/ImageTest.jpdl.xml")
.addResourceFromClasspath("org/jbpm/test/deploy/ImageTest.png")
.deploy();
ProcessDefinition processDefinition = repositoryService
.createProcessDefinitionQuery()
.processDefinitionKey("ImageTest")
.uniqueResult();
String imageResourceName = processDefinition.getImageResourceName();
assertEquals("org/jbpm/test/deploy/ImageTest.png", imageResourceName);
InputStream inputStream =
repositoryService.getResourceAsStream(processDefinition.getDeploymentDbid(),
imageResourceName);
byte[] imageBytes = IoUtil.readBytes(inputStream);
inputStream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jbpm/test/deploy/ImageTest.png");
byte[] expectedImageBytes = IoUtil.readBytes(inputStream);
assertTrue(Arrays.equals(expectedImageBytes, imageBytes));
repositoryService.deleteDeploymentCascade(deploymentDbid);
add resource lookup by process definition id
--------------------------------------------
Key: JBPM-2269
URL:
https://jira.jboss.org/jira/browse/JBPM-2269
Project: JBoss jBPM
Issue Type: Task
Security Level: Public(Everyone can see)
Components: Runtime Engine
Reporter: Tom Baeyens
Assignee: Tom Baeyens
Priority: Critical
Fix For: jBPM 4.0.0.CR1
Add
InputStream getResourceAsStream(String processDefinitionId, String resourceName);
to
RepositoryService
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira