示例#1
0
 public Node getNode(Element element) {
   for (Node node : listNode) {
     if (node.getElement().getId().equals(element.getId())) {
       return node;
     }
   }
   return null;
 }
示例#2
0
 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());
   }
 }