@Override
  protected void handleNotificationEvent(Notification notification) {
    super.handleNotificationEvent(notification);
    if ((notification.getEventType() == Notification.SET)
        && (notification.getNotifier() instanceof org.ow2.aspirerfid.ide.bpwme.impl.EBProcImpl)) {

      EBProcImpl epi = (EBProcImpl) notification.getNotifier();
      EAttributeImpl ei = (EAttributeImpl) notification.getFeature();
      MainControl mc = MainControl.getMainControl();

      org.ow2.aspirerfid.commons.apdl.model.EBProc ebproc =
          (org.ow2.aspirerfid.commons.apdl.model.EBProc) mc.getMapObject(epi.hashCode());

      EPCISMasterDataDocumentType doc = MasterDataUtil.getEPCISMasterDataDocument(ebproc);
      VocabularyElementType vocabularyElement = MasterDataUtil.getEBProcVocabularyElement(doc);

      if (ei.getName().equals("id")) {
        ebproc.setId(notification.getNewStringValue());
        MasterDataUtil.setVocabularyElementID(vocabularyElement, notification.getNewStringValue());
      } else if (ei.getName().equals("name")) {
        ebproc.setName(notification.getNewStringValue());
        MasterDataUtil.setVocabularyElementAttribute(
            vocabularyElement,
            "urn:epcglobal:epcis:mda:event_name",
            notification.getNewStringValue());
      } else if (ei.getName().equals("description")) {
        ebproc.setDescription(notification.getNewStringValue());
      } else {
        return;
      }

      mc.saveObject();
    }
  }
Beispiel #2
0
 public org.ow2.aspirerfid.commons.apdl.model.EBProc createEBProc(
     org.ow2.aspirerfid.commons.apdl.model.CLCBProc clcb) {
   org.ow2.aspirerfid.commons.apdl.model.EBProc ebproc = objectFactory.createEBProc();
   clcb.getEBProc().add(ebproc);
   ebproc.setApdlDataFields(objectFactory.createApdlDataFields());
   saveObject();
   return ebproc;
 }