cancel
Showing results for 
Search instead for 
Did you mean: 

Extension element and CDATA text

wilco
Champ in-the-making
Champ in-the-making
Hi!
I'm heavily using ExtensionsElement elements in the workflow configuration to include custom configuration code:

<userTask id="writeReportTask" name="writeReportTask" activiti:formKey="com.bla">
  <extensionElements>
    <miriam:extension>
      <miriam:configuration name="dataConsumesTag" value="writeReportTask_consumesTag" />
      <miriam:configuration name="dataProducesFilename">
          test:<![CDATA[cdataText]]>
      </miriam:configuration>
    </miriam:extension>
  </extensionElements>
</userTask>


This works quite well using the ExtensionElement API in 5.14. But the field named "dataProducesFilename" above contains a CDATA field as element text which is not available via the API. In the case above only the string "test:" is returned by the getElementText() method and the CDATA string is missing completly. How can I get the CDATA value? Or is it a bug?

Thanks! Wilco
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Not really sure you can mix CDATA and normal text in XML… If I remember correcltly, its better to wrap ALL of the text-content inside the CDATA block.

wilco
Champ in-the-making
Champ in-the-making
I tried this as well, but then the getElementText() method just returns an empty string.

frederikherema1
Star Contributor
Star Contributor
That's strange, since we use the same approach (getElementText()) for script-tasks, which generally always have a CDATA declaration:


((ScriptTask) parentElement).setScript(xtr.getElementText());

Did you double-check the correct CDATA-syntax?