JSONObject connectionsObject = new JSONObject();
for(GraphWrapper gw : this.boxes.keySet()) {
AbstractRuleOperator op = (AbstractRuleOperator) gw.getElement();
saveObject.put(op.getName(), op.toJSON(connectionsObject));
}
if(connectionsObject.length() > 0) {
saveObject.put("connections", connectionsObject);
}