Beispiel #1
0
  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);
  }
Beispiel #2
0
 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);
 }