cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing custom extensionElements in 5.12

das
Champ in-the-making
Champ in-the-making
Hi,

I'm using custom <extensionElements> to create taskListeners for specific tasks.
In 5.11 I'm using a BpmnParseListener and reading the tags via "taskElement.element("extensionElements").elementsNS(..)".

I tried the new BpmnParseHandler, but the XML information is not available.
As far as I could find, all XML info is parsed in BpmnXMLConverter and converted into POJOs to be used in the parse handlers.

Any pointers on how to handle custom XML extensions in 5.12?

Thanks
20 REPLIES 20

sebastian_s
Champ in-the-making
Champ in-the-making
Hello Tijs,

please point me to the JIRA issue.

Thanks a lot.

Sebastian

trademak
Star Contributor
Star Contributor
We have a JIRA related to the Designer, but to solve that we also need to fix it in the parser:

http://jira.codehaus.org/browse/ACT-1683

The work in the parser has been done already, we only need to upgrade the designer with the new JARs.
Would be good if you could give it a try on the current Github master version. There is a method getExtensionElements() that can be used to get the extension elements of a BPMN element.

Best regards,

pkromolowski
Champ in-the-making
Champ in-the-making
Hi,

I am now downloading Activiti 5.13, but I must ask you this question - did you manage to fix the issue above in the new version ? I couldn't find it in the Changelog and will only be able to check this out in the evening.

Thanks,
Przemek

pkromolowski
Champ in-the-making
Champ in-the-making
Ok, I couldn't wait and did a quick look into the new version. I can see that there is a org.activiti.bpmn.model.BaseElement.getExtensionElements() method, I suppose that this is what I sould use the read the extension elements. Am I right?

Thanks,

sebastian_s
Champ in-the-making
Champ in-the-making
Hello Tijs,

Sorrry, but I didn't take notice of your answer until now. Now that 5.13 has been released it's a bit late but I am sure I'll have a look at it since we also depend on extension elements. Smiley Happy So thanks for the fix.

Przemek, thank you for keeping the rest on us on the forums updated on this.

Best regards!

jbarrez
Star Contributor
Star Contributor
Yes - it was added to 5.13.

rhafner
Champ on-the-rise
Champ on-the-rise
There appears be a limitation in the current implementation of org.activiti.bpmn.model.BaseElement.getExtensionElements(). Since it returns a Map<String,ExtensionElement> with the elementName as the key there isn't a way to parse multiple XML elements of the same type. Was this intended? If so, is there a recommended approach to model custom key/value extension elements to avoid this limitation? Thanks!

For example:
<code>
    <userTask id="usertask1" name="Task A">
     <extensionElements>
      <myext:attributes>
    <myext:attribute name="Attr1" value="1" />
    <myext:attribute name="Attr2" value="2" />
   </myext:attributes>
       </extensionElements>   
    </userTask>
</code>

jbarrez
Star Contributor
Star Contributor
Seems indeed to be a limitation which shouldn't be there. After all the ExtensionElement class does have support for child elements.

I pinged Tijs (who wrote this code) to clarify/fix.

rhafner
Champ on-the-rise
Champ on-the-rise
Has a jira issue been opened for this limitation? If not, should I open one?

trademak
Star Contributor
Star Contributor
In this commit the issue was fixed, so it will be part of the next 5.14 release:

https://github.com/Activiti/Activiti/commit/6c0563799439dfa5ab662e51d9725649860a6d67

Best regards,