BOChangeSummary

Questa interfaccia fornisce miglioramenti all'interfaccia ChangeSummary, in modo da gestire l'intestazione del riepilogo modifiche del grafico business.

Scopo

BOChangeSummary aggiunge ulteriori funzioni all'interfaccia ChangeSummary abilitando la gestione dell'intestazione del Riepilogo modifiche del grafico business.

L'interfaccia ChangeSummary fornisce l'accesso per modificare le informazioni sulla cronologia per gli oggetti di dati in un grafico di dati. La modifica della cronologia interessa qualunque modifica effettuata all'avvio del grafico di dati dal punto in cui è stata attivata la registrazione. Se la registrazione non è più attiva, il log comprende solo le modifiche effettuate fino al punto in cui è stata disattivata la registrazione. Altrimenti, comprende tutte le modifiche fino al punto in cui è stata eseguita l'interrogazione di ChangeSummary.

Nota: L'interfaccia di programmazione dell'applicazione (API) addOldValue consente di impostare il valore se non si dispone del valore precedente. Questo API prevede che il valore non viene impostato prima di essere richiamato. Se si tenta di richiamarlo e il valore è già impostato, viene restituita un'eccezione.

Esempio

L'esempio di seguito riportato illustra il modo in cui utilizzare BOChangeSummary.

BOFactory factoryService =
    (BOFactory) new
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOChangeSummary changeSummaryService =
    (BOChangeSummary) new
ServiceManager().locateService("com/ibm/websphere/bo/BOChangeSummary");
BODataObject dataObjectService =
    (BODataObject) new ServiceManager().locateService("com/ibm/websphere/bo/BODataObject");

DataObject productCategoryBG =
  factoryService.create("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
                          "ProductCategoryBG");
DataObject productCategory =
  productCategoryBG.createDataObject("productCategory");
DataObject product1 =
  productCategory.createDataObject("product");
DataObject product2 =
  productCategory.createDataObject("product");

// Due meccanismi per trovare il riepilogo modifiche:
// 
// 1. Dal grafico business
ChangeSummary changeSummary =
    (ChangeSummary) productCategoryBG.get("changeSummary");

// 2. Da un qualunque oggetto di dati utilizzando un metodo di convenienza.
ChangeSummary changeSummary2 =
  dataObjectService.getChangeSummary(productCategory);

changeSummary.beginLogging();

productCategory.setBoolean("domestic", false);
product1.set("description", "NewValue");
product1.set("description", "NewValue2");
product2.set("description", "NewValue");
product2.set("description", "NewValue2");

changeSummary.endLogging();

List changedDataObjects =
  changeSummary.getChangedDataObjects();
Iterator i = changedDataObjects.iterator();
while (i.hasNext()) {
  DataObject dataObject = (DataObject) i.next();

  if (changeSummary.isDeleted(dataObject)) {
      // ...
      continue;
  }

  if (changeSummary.isCreated(dataObject)) {
      // ...
        continue;
    }

    if (changeSummaryService.isUpdated(dataObject)) {
      // ...
        continue;
  }
}

// Annotare l'oggetto di categoria del prodotto con un evento modificato dell'oggetto.
changeSummaryService.setCreated(productCategory);

// Annotare una proprietà nella categoria del prodotto 
// oggetto con un evento modificato della proprietà
changeSummaryService.addOldValue(productCategory, "ID", null, true);

List changeSummarySettings =
    changeSummary.getOldValues(productCategory);
Iterator i2 = changeSummarySettings.iterator();
while (i2.hasNext()) {
    ChangeSummary.Setting setting = (ChangeSummary.Setting) i2.next();
    System.out.println("setting getProperty(): " + setting.getProperty());
    System.out.println("setting getValue(): " + setting.getValue());
    System.out.println("setting isSet(): " + setting.isSet());
}

DataObject product3 = productCategory.createDataObject(“product”);

//spostare product3 alla posizione 0 nell'elenco e
//Effettuare le modifiche appropriate a changesummary.
changeSummaryService.markListEntryMoved(product3, productCategory, “product”, 0);

product3.set(“description”, “NewValue”);

//Contrassegnare esplicitamente la voce dell'elenco come creata in changesummary.
changeSummaryService.markSimpleTypeCreated(“NewValue”, product, “description”);

product3.set(“description”, “NewValue2”);
changeSummaryService.markSimpleTypeCreated(“NewValue2”, product, “description”);

//eliminare la voce dell'elenco ed aggiungere una voce di modifica dell'elenco nel riepilogo modifiche.
changeSummaryService.markSimpleTypeDeleted(“NewValue2”, product, “description”);

product1.delete();
// Il contenitore precedente restituirà l'oggetto productCategory 
// poiché questo è il contenitore precedente per product1.
changeSummaryService.getOldContainer(product1);

// restituirà la proprietà del contenitore precedente, ovvero
// ciò che il nome della proprietà è nell'oggetto productCategory.
changeSummaryService.getOldContainmentProperty(product1);
Riferimenti correlati
BOCopy
BODataObject
BOEquality
BOEventSummary
BOFactory
BOType
BOTypeMetadata
BOXMLDocument
BOXMLSerializer
Informazioni correlate
API BOChangeSummary interfaccia

Terms of use |

Last updated: Thu Apr 06 14:28:02 2006

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)