Hi,
In my application, I generate the BPMNModel object thorough the java api’s.
Then pass the bytearray of the same for the deployment.
I have a requirement where i need to have IntermediateSignalCatchEvent with the signal name as dynamic.
For this i used : org.flowable.bpmn.model.SignalEventDefinition#setSignalExpression method.
SignalEventDefinition definition = new SignalEventDefinition();
definition.setSignalExpression("${signalName}");
eventDefinitions.add(definition);
I observed that the BPMNModel object has the information about the signalExpression.
But when I use org.flowable.bpmn.converter.BpmnXMLConverter#convertToXML(org.flowable.bpmn.model.BpmnModel) to generate the byte array
The generate byte array does not have the information about the signalExpression and only the empty signalEventDefinition tag is present.
On debugging I found that the following code does not appear to consider the signalExpression from the SignalEventDefinition object.
protected void writeSignalDefinition(Event parentEvent, SignalEventDefinition signalDefinition, XMLStreamWriter xtw) throws Exception {
xtw.writeStartElement(ELEMENT_EVENT_SIGNALDEFINITION);
writeDefaultAttribute(ATTRIBUTE_SIGNAL_REF, signalDefinition.getSignalRef(), xtw);
if (parentEvent instanceof ThrowEvent && signalDefinition.isAsync()) {
BpmnXMLUtil.writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_ASYNCHRONOUS, “true”, xtw);
}
boolean didWriteExtensionStartElement = BpmnXMLUtil.writeExtensionElements(signalDefinition, false, xtw);
if (didWriteExtensionStartElement) {
xtw.writeEndElement();
}
xtw.writeEndElement();
}
Is this the intended behavior or is it a bug?
If it is the intended behavior then can you please share the info as to how i can add the signalExpression to the finale byte array?