cancel
Showing results for 
Search instead for 
Did you mean: 

Get Process Documentation

krigu
Champ in-the-making
Champ in-the-making
Is it possible to get (via Java) the documentation of the process itself somehow?


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="MyFirstProcess" name="MyFirstProcess">
    <documentation>This is the text i like to get</documentation>


Thanks
10 REPLIES 10

trademak
Star Contributor
Star Contributor
Hi,

No this is not available via the Activiti API.
But it shouldn't be too hard to make it available. Can you create a JIRA?

Best regards,

krigu
Champ in-the-making
Champ in-the-making

krigu
Champ in-the-making
Champ in-the-making
I found out this feature got implemented in Version 5.10. Thanks a lot.

However, I tried to get the documentation with the new method but I always recieve null.

This is my unittest:
@Rule
public ActivitiRule activitiRule = new ActivitiRule();

@Test
@Deployment(resources = { "diagrams/MyProcess.bpmn" })
public void descriptionTest() {

  RuntimeService runtimeService = activitiRule.getRuntimeService();
  runtimeService.startProcessInstanceByKey("MyProcess");

  ProcessDefinition r =  activitiRule
    .getRepositoryService().createProcessDefinitionQuery().list()
    .get(0);
 
  assertNotNull(r.getDescription()); // Always fails
 
}

The bpmn looks like:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.ultrasoft.ch/">
  <process id="MyProcess" name="MyName">
    <documentation>My Documentation</documentation>
<!– and so on… –>

I get the correct name, namespace, etc, but the description is always null. Am I doing something wrong?

jbarrez
Star Contributor
Star Contributor
Could you attach your unit test + process to that jira issue and reopen it?

krigu
Champ in-the-making
Champ in-the-making
Could you attach your unit test + process to that jira issue and reopen it?

Done. I provided a small standalone testcase with maven. Hope it helps!

Thanks for your work!

jbarrez
Star Contributor
Star Contributor
Thanks. I'll look into it.

marcthomas2012
Champ in-the-making
Champ in-the-making
I have just come across this exact same issue with getDescription() returning null.

Do you have any idea when this issue is planned to be fixed? My code is relying on it working and we ship at the end of the month. Smiley Sad

Any assistance, temporary work arounds would be appreciated.

Thanks
Marc

jbarrez
Star Contributor
Star Contributor
I believe Bernd fixed it on master: see https://jira.codehaus.org/browse/ACT-1020

marcthomas2012
Champ in-the-making
Champ in-the-making
Does anyone know when 5.11 will be made available?