BOChangeSummary

이 인터페이스는 비즈니스 그래프 변경 요약 헤더를 관리하는 ChangeSummary 인터페이스의 향상된 기능을 제공합니다.

용도

BOChangeSummary는 ChangeSummary 인터페이스에 기능을 추가하여 비즈니스 그래프 변경 요약 헤더를 관리할 수 있도록 합니다.

ChangeSummary 인터페이스는 데이터 그래프의 데이터 오브젝트 변경 히스토리 정보에 대한 액세스를 제공합니다. 변경 히스토리에는 로깅이 활성화된 시점부터 시작되는 데이터 그래프의 수정사항이 포함됩니다. 로깅이 비활성화되면 로그에는 로깅이 비활성화된 시점까지 변경된 사항만 포함됩니다. 그렇지 않으면 ChangeSummary에 문의 중인 시점까지 변경된 모든 사항이 포함됩니다.

주: 이전 값이 없는 경우 addOldValue API를 사용하여 이전 값을 설정할 수 있습니다. 이 API에서는 값을 호출하기 전에 설정되지 않은 것으로 간주합니다. 값을 호출할 때 값이 이미 설정된 경우 예외를 수신하게 됩니다.

다음 예는 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");

// Two mechanisms to find the change summary:
// 
// 1. From the Business Graph.
ChangeSummary changeSummary =
    (ChangeSummary) productCategoryBG.get("changeSummary");

// 2. From any data object using a convenience method.
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;
  }
}

// Annotate the product category object with an object changed event.
changeSummaryService.setCreated(productCategory);

// Annotate a property on the product category 
// object with a property changed event.
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”);

//move product3 to location 0 in the list and
//Make the appropriate changes to the changesummary.
changeSummaryService.markListEntryMoved(product3, productCategory, “product”, 0);

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

//Explicitly mark the list entry as created in the changesummary.
changeSummaryService.markSimpleTypeCreated(“NewValue”, product, “description”);

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

//Delete the list entry and add a list change entry in the change summary.
changeSummaryService.markSimpleTypeDeleted(“NewValue2”, product, “description”);

product1.delete();
// The old container will return the productCategory object 
// since that is the old container for product1.
changeSummaryService.getOldContainer(product1);

// This will return the old containment property that is
// what the property name is in the productCategory object.
changeSummaryService.getOldContainmentProperty(product1);
관련 참조
BOCopy
BODataObject
BOEquality
BOEventSummary
BOFactory
BOType
BOTypeMetadata
BOXMLDocument
BOXMLSerializer
관련 정보
인터페이스 BOChangeSummary API

Terms of use |

Last updated: Thu Mar 23 18:54:58 2006

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