コード例 #1
0
  public void newObject() throws KExceptionClass {
    try {

      if (EventCallback != null) EventCallback.preNewObject();

      KBusinessObjectClass businessObject = pdcClassType.newInstance();

      KMetaUtilsClass.setProgressBarValue1(25);
      businessObject = persistentObjectManager.createNew4(businessObject);

      // map foreing keys
      KMetaUtilsClass.setProgressBarValue1(50);
      if (buisnessObjectForeingOIDS != null) {
        Set listOfForeingKeys = buisnessObjectForeingOIDS.keySet();
        Iterator foreingKeyIterator = listOfForeingKeys.iterator();
        while (foreingKeyIterator.hasNext()) {
          String nextForeingKeyName = (String) foreingKeyIterator.next();
          businessObject.setField(
              nextForeingKeyName, buisnessObjectForeingOIDS.get(nextForeingKeyName));
        }
      }

      KMetaUtilsClass.setProgressBarValue1(75);
      businessObject.displayVisualize(visualWidgetContainer, nonVisibleWidgets, visualMappingMode);

      if (EventCallback != null) EventCallback.postNewObject(businessObject);

    } catch (Exception error) {
      throw new KExceptionClass("Could not create new object", error);
    }

    KMetaUtilsClass.setProgressBarValue1(100);
  }