[
https://jira.jboss.org/jira/browse/JBPM-2365?page=com.atlassian.jira.plug...
]
Tom Baeyens commented on JBPM-2365:
-----------------------------------
these two methods are added:
/** the resource name for the given start activity. It is assumed that
* the ProcessDefinition is already retrieved. From the ProcessDefinition,
* the {@link ProcessDefinition#getId()} and the {@link
ProcessDefinition#getDeploymentId()}
* can be retrieved. The activityName can be obtained via {@link
#getStartActivityNames(String)}.
* An InputStream for the resource can be obtained with {@link
#getResourceAsStream(String, String)} */
String getStartFormResourceName(String processDefinitionId, String activityName);
/** the coordinates for the activity on
* {@link ProcessDefinition#getImageResourceName() the process image}. */
ActivityCoordinates getActivityCoordinates(String processDefinitionId, String
activityName);
here's the example usage (ProcessDefinitionStartFormTest):
public void testFormInUnnamedStartActivity() {
String deploymentDbid =
repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='make print'>" +
" <start
form='org/jbpm/test/process/ProcessDefinitionStartForm.form' />" +
"</process>"
)
.addResourceFromClasspath("org/jbpm/test/process/ProcessDefinitionStartForm.form")
.deploy();
registerDeployment(deploymentDbid);
ProcessDefinition processDefinition =
repositoryService
.createProcessDefinitionQuery()
.processDefinitionName("make print")
.uniqueResult();
String processDefinitionId = processDefinition.getId();
List<String> startActivityNames =
repositoryService.getStartActivityNames(processDefinitionId );
List<String> expectedStartActivityNames = new ArrayList<String>();
expectedStartActivityNames.add(null);
assertEquals(expectedStartActivityNames, startActivityNames);
String startFormResourceName =
repositoryService.getStartFormResourceName(processDefinitionId, null);
assertEquals("org/jbpm/test/process/ProcessDefinitionStartForm.form",
startFormResourceName);
InputStream formInputStream =
repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
startFormResourceName);
String formContents = new String(IoUtil.readBytes(formInputStream));
assertEquals("start task form", formContents);
}
public void testFormInNamedStartActivity() {
String deploymentDbid =
repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='make print'>" +
" <start name='start'
form='org/jbpm/test/process/ProcessDefinitionStartForm.form' />" +
"</process>"
)
.addResourceFromClasspath("org/jbpm/test/process/ProcessDefinitionStartForm.form")
.deploy();
registerDeployment(deploymentDbid);
ProcessDefinition processDefinition =
repositoryService
.createProcessDefinitionQuery()
.processDefinitionName("make print")
.uniqueResult();
String processDefinitionId = processDefinition.getId();
List<String> startActivityNames =
repositoryService.getStartActivityNames(processDefinitionId );
List<String> expectedStartActivityNames = new ArrayList<String>();
expectedStartActivityNames.add("start");
assertEquals(expectedStartActivityNames, startActivityNames);
String startFormResourceName =
repositoryService.getStartFormResourceName(processDefinitionId, "start");
assertEquals("org/jbpm/test/process/ProcessDefinitionStartForm.form",
startFormResourceName);
InputStream formInputStream =
repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
startFormResourceName);
String formContents = new String(IoUtil.readBytes(formInputStream));
assertEquals("start task form", formContents);
}
Clarification (and API) how "Start process with task form"
should work
----------------------------------------------------------------------
Key: JBPM-2365
URL:
https://jira.jboss.org/jira/browse/JBPM-2365
Project: JBoss jBPM
Issue Type: Task
Security Level: Public(Everyone can see)
Components: Runtime Engine
Reporter: Heiko Braun
Assignee: Tom Baeyens
Fix For: jBPM 4.0
--
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