cancel
Showing results for 
Search instead for 
Did you mean: 

Form property missing when BPMN Model converted to XML

vgaur
Confirmed Champ
Confirmed Champ
Hi,

I am trying to generate XML from BPMN model. I have a user task which has a Form Definition which in turn contains several properties.
when I convert this model into XML , I don't see the extension tag. All form properties are missing in the generated xml.

Do I need to set any special flag or something ?
5 REPLIES 5

vgaur
Confirmed Champ
Confirmed Champ
I just run test case in BPMN converter module and its creating the form properties properly.  To give you more insight, I am using activiti-simple-workflow , creating workflow definition (with form properties) and converting it in XML.

vgaur
Confirmed Champ
Confirmed Champ
OK So I get this.
FormProperty id is a mandatory property and in simple-workflow-converter , when we convert HumanStep we set the id in formProperty with the name of formPropertyDefinition
<code>
      formProperty.setId(propertyDefinition.getName());
</code>

trademak
Star Contributor
Star Contributor
So the issue is resolved?

vgaur
Confirmed Champ
Confirmed Champ
Yes Tijs,

I was not setting the name in FormPropertyDefinition and when I converted it into bpmn xml , the form properties were missing.
When I debugged I found that in org.activiti.bpmn.converter.BaseBpmnXMLConverter.writeFormProperties() there is check for id
<code> if (StringUtils.isNotEmpty(property.getId())) </code> . 

So that means in FormPropertyDefinition  name is a mandatory property. Ideally it should fail fast  if name is not present.  Also we should check if id is missing then only set id with name.

I have fixed few such issues and would like that to contribute if that helps.

jbarrez
Star Contributor
Star Contributor
All contributions are more than welcome! Looking forward to the pull request 😉