public Node getNode(Element element) { for (Node node : listNode) { if (node.getElement().getId().equals(element.getId())) { return node; } } return null; }
public void connect(Element source, Element target, Connection connection) { Node nodeSource = getNode(source); Node nodeTarget = getNode(target); nodeSource.addTarget(nodeTarget); nodeTarget.addSource(nodeSource); nodeSource.setConnection(connection); listFirstNode.remove(nodeTarget); if (!nodeTarget.getForm().getFormType().getName().equalsIgnoreCase(Constants.FORM_TYPE_NOINPUT) && !nodeTarget .getForm() .getFormType() .getName() .equalsIgnoreCase(Constants.FORM_TYPE_NOMATCH)) { Object formId = ((FormEntity) nodeSource.getElement().getData()).getFormId(); ((AbstractFormEntity) formId).setNextForm(((FormEntity) target.getData()).getId()); } }