outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getId()));
}
if (flowElement instanceof Activity) {
Activity activity = (Activity) flowElement;
for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(boundaryEvent.getId()));
}
if (activity.isAsynchronous()) {
propertiesNode.put(PROPERTY_ASYNCHRONOUS, PROPERTY_VALUE_YES);
}
if (activity.isNotExclusive()) {
propertiesNode.put(PROPERTY_EXCLUSIVE, PROPERTY_VALUE_NO);
}
if (activity.getLoopCharacteristics() != null) {
MultiInstanceLoopCharacteristics loopDef = activity.getLoopCharacteristics();
if (StringUtils.isNotEmpty(loopDef.getLoopCardinality()) || StringUtils.isNotEmpty(loopDef.getInputDataItem()) ||
StringUtils.isNotEmpty(loopDef.getCompletionCondition())) {
if (loopDef.isSequential() == false) {
propertiesNode.put(PROPERTY_MULTIINSTANCE_SEQUENTIAL, PROPERTY_VALUE_NO);
}
if (StringUtils.isNotEmpty(loopDef.getLoopCardinality())) {
propertiesNode.put(PROPERTY_MULTIINSTANCE_CARDINALITY, loopDef.getLoopCardinality());
}
if (StringUtils.isNotEmpty(loopDef.getInputDataItem())) {
propertiesNode.put(PROPERTY_MULTIINSTANCE_COLLECTION, loopDef.getInputDataItem());
}
if (StringUtils.isNotEmpty(loopDef.getElementVariable())) {
propertiesNode.put(PROPERTY_MULTIINSTANCE_VARIABLE, loopDef.getElementVariable());
}
if (StringUtils.isNotEmpty(loopDef.getCompletionCondition())) {
propertiesNode.put(PROPERTY_MULTIINSTANCE_CONDITION, loopDef.getCompletionCondition());
}
}
}
if (activity instanceof UserTask) {
addListeners(((UserTask) activity).getTaskListeners(), false, propertiesNode);
} else {
addListeners(activity.getExecutionListeners(), true, propertiesNode);
}
}
flowElementNode.put("outgoing", outgoingArrayNode);
}