if (itemsArrayNode != null) {
for (JsonNode itemNode : itemsArrayNode) {
JsonNode typeNode = itemNode.get(eventType);
if (typeNode != null && StringUtils.isNotEmpty(typeNode.asText())) {
ActivitiListener listener = new ActivitiListener();
listener.setEvent(typeNode.asText());
if (StringUtils.isNotEmpty(getValueAsString(listenerClass, itemNode))) {
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
listener.setImplementation(getValueAsString(listenerClass, itemNode));
} else if (StringUtils.isNotEmpty(getValueAsString(listenerExpression, itemNode))) {
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
listener.setImplementation(getValueAsString(listenerExpression, itemNode));
} else if (StringUtils.isNotEmpty(getValueAsString(listenerDelegateExpression, itemNode))) {
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION);
listener.setImplementation(getValueAsString(listenerDelegateExpression, itemNode));
}
listenerFieldsNode = itemNode.get(listenerFields);
if (listenerFieldsNode != null && StringUtils.isNotEmpty(listenerFieldsNode.asText()) && !("undefined".equals(listenerFieldsNode.asText()))){
if(listenerFieldsNode.isValueNode()){
try{
listenerFieldsNode = objectMapper.readTree(listenerFieldsNode.asText());
} catch(Exception e){
LOGGER.info("Listener fields node can not be read", e);
}
}
}
if (listenerFieldsNode != null) {
listenerFieldsArrayNode = listenerFieldsNode.get(EDITOR_PROPERTIES_GENERAL_ITEMS);
List<FieldExtension> fields = new ArrayList<FieldExtension>();
if (listenerFieldsArrayNode != null) {
for (JsonNode fieldNode : listenerFieldsArrayNode){
JsonNode fieldNameNode = fieldNode.get(listenerFieldName);
if (fieldNameNode != null && StringUtils.isNotEmpty(fieldNameNode.asText())){
FieldExtension field = new FieldExtension();
field.setFieldName(fieldNameNode.asText());
field.setStringValue(getValueAsString(listenerFieldValue, fieldNode));
field.setExpression(getValueAsString(listenerFieldExpression, fieldNode));
fields.add(field);
}
}
}
listener.setFieldExtensions(fields);
}
if (element instanceof Process) {
((Process) element).getExecutionListeners().add(listener);
} else if (element instanceof SequenceFlow) {