예제 #1
0
  /* (non-Javadoc)
   * @see org.netbeans.modules.soa.model.bpel20.xam.spi.InnerEventDispatcher#isApplicable(org.netbeans.modules.soa.model.bpel20.api.events.ChangeEvent)
   */
  public boolean isApplicable(ChangeEvent event) {

    boolean flag =
        (event instanceof EntityInsertEvent)
            || (event instanceof EntityUpdateEvent)
            || (event instanceof ArrayUpdateEvent);

    if (!flag) {
      return false;
    }

    if (event.getParent().getBpelModel().inSync()) {
      return false;
    }

    if (!((BpelEntityImpl) event.getParent()).isInTree()) {
      return false;
    }
    return true;
  }
예제 #2
0
  /* (non-Javadoc)
   * @see org.netbeans.modules.soa.model.bpel20.xam.spi.InnerEventDispatcher#preDispatch(org.netbeans.modules.soa.model.bpel20.api.events.ChangeEvent)
   */
  public void preDispatch(ChangeEvent event) {

    /*
     * In preDispatch I will find declared namespaces
     * in subject entities that already defined somewhere in parent.
     * Such namespaces already not needed. They could be removed
     * and corresponding prefixes that used in attribute values
     * should be changed to prefix for this namespace that exist in parent.
     */

    BpelEntity entity = getSingleEntity(event);
    BpelEntity[] entities = getEntityArray(event);

    if (entity != null) {
      /*
       *  Only element that was built we will handle.
       *  Elements that was created via "copy" we don't want to handle.
       */
      if (!isMarked(entity)) {
        return;
      }
      Map<String, String> map = new HashMap<String, String>();
      removeExistedNamespaces(entity, event.getParent(), map);
      addEvent(event);
    } else if (entities != null) {
      for (BpelEntity ent : entities) {
        /*
         *  Only element that was built we will handle.
         *  Elements that was created via "copy" we don't want to handle.
         */
        if (!isMarked(entity)) {
          continue;
        }
        Map<String, String> map = new HashMap<String, String>();
        removeExistedNamespaces(ent, event.getParent(), map);
      }
      addEvent(event);
    }
  }