Pass custom attributes in Script Task


How can I add custom attributes like customKey below to the scriptTask or any task in XML process definition?

<scriptTask id="<id>" name="<name>" flowable:async="true" flowable:exclusive="false" flowable:customKey="myValue">

I see that this works well in UserTask, ie. custom attributes get set in FlowNode.attributes as key and value. Refer:

But the same with different task types, like script task is not happenning. Is there a way to customize this behaviour in XML parsing?


If you add BpmnXMLUtil.addCustomAttributes(... to ScriptTaskXMLConverter it should add custom attributes to the script task. Custom properties must also added to the moduleā€¦
What is not clear to me is how will you use these custom attributes in the script engine execution. You can easily add them to the script if you want to.


Is there a way I can add this change and set it as converter in configuration? Since ScriptTaskXMLConverter is in flowable code, I need a way to override/add addCustomAttributes method to this converter.

I am making some custom changes in execution where I have access to FlowNode and thus I can get attributes from it.

I did not find an easy way how to do it.