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()); } }
public void disconnect(Element source, boolean allNodes) { Node nodeSource = getNode(source); FormEntity formSource = nodeSource.getForm(); List<Node> targets = nodeSource.getListTarget(); if (formSource.getFormType().getName().equals(Constants.FORM_TYPE_PROMPT_COLLECT) && !allNodes) { boolean found = false; for (int index = 0; index < targets.size() && !found; index++) { Node target = targets.get(index); FormEntity formTarget = target.getForm(); if (!(formTarget.getFormType().getName().equals(Constants.FORM_TYPE_NOINPUT) || formTarget.getFormType().getName().equals(Constants.FORM_TYPE_NOMATCH))) { target.remSource(nodeSource); if (target.getListSource().size() == 0) { listFirstNode.add(target); } nodeSource.remTarget(target); found = true; } } } else { for (Node target : targets) { target.remSource(nodeSource); if (target.getListSource().size() == 0) { listFirstNode.add(target); } } } nodeSource.setConnection(null); nodeSource.getForm().setNextForm(null); nodeSource.getForm().setTag(null); ((FormEntity) nodeSource.getElement().getData()).setTag(null); ((FormEntity) nodeSource.getElement().getData()).setNextForm(null); Object formId = ((FormEntity) nodeSource.getElement().getData()).getFormId(); ((AbstractFormEntity) formId).setNextForm(null); ((AbstractFormEntity) formId).setTag(null); }
public void disconnect(Element source, Element target) { Node nodeSource = getNode(source); Node nodeTarget = getNode(target); List<Node> targets = nodeSource.getListTarget(); for (Node targetAux : targets) { if (targetAux.equals(nodeTarget)) { targetAux.remSource(nodeSource); if (targetAux.getListSource().size() == 0) { listFirstNode.add(targetAux); } } } nodeSource.remTarget(nodeTarget); nodeSource.setConnection(null); nodeSource.getForm().setNextForm(null); nodeSource.getForm().setTag(null); ((FormEntity) nodeSource.getElement().getData()).setTag(null); ((FormEntity) nodeSource.getElement().getData()).setNextForm(null); Object formId = ((FormEntity) nodeSource.getElement().getData()).getFormId(); ((AbstractFormEntity) formId).setNextForm(null); ((AbstractFormEntity) formId).setTag(null); }