Defining Extension

Use the Extension page to define the extension application class that will be used by the object owner to provide custom PeopleCode validate, transforms, and merge data set instances.

Navigation:

From the General page > Extension tab.

This example illustrates the fields and controls on the Data Set Designer – Extension page. You can find definitions for the fields and controls later on this page.

Data Set Designer - Extension page

The applicant class the user specifies on this page will extend the PTADSDEFN:AdsValidationBase application class that is part of the data set framework. Specific methods of the AdsValidationBase application class or its extension class are invoked at a particular time during processing.

There are four areas of functionality controlled by in the AdsValidationBase application class that are designed to be implemented by object owners:

  • DB Integrity Checks

  • To File Custom Transforms

  • From File Custom Transforms

  • From File Custom Merging

Application Class Extension

Developers can extend the PTADSDEFN:AdsValidationBase base class to define specific validation logic. AdsValidationBase provides an empty implementation of the methods of the Application Class that a data set definition may be associated with. To provide validation or transformation logic in PeopleCode, a developer will override the appropriate base class methods and provide additional methods and properties as necessary.

Validation is implemented in the CustomValidate method. See CustomValidate.

Important! Unless mentioned in this document as being designed for extension other methods in the AdsValidationBase base class are used internally so changing or overriding them will modify basic behavior.

DB Integrity Checks

The Database Integrity Check should be run on the target database after the copy from file to ensure database integrity.

DB Integrity Checks use the DoADSValidations method provided in the AdsValidationBase base class. This method will validate for static prompts, translates, Y/N values, and required fields. If a validation error is detected, information about the error is written to a target database table and DoADSValidations returns false to the C++ layer. Thus even if no application class has been associated with the ADS definition, this method will perform the default validations.

To File Custom Transforms

To File Custom Transforms are used by the owners of a few objects to implement custom transform instances from a newer PeopleTools release to an older release, such as from 8.54 to 8.53. This transform is applied at copy to file time and on the newer release. The ADS and record definitions of both the newer and older release must be present.

The transform is implemented in the DoTransform method. See DoTransform.

From File Custom Transforms

From File Custom Transforms might be used by the owners of a few objects in a few circumstances such as:

  1. To implement custom transform instances from a older PeopleTools release to an newer release, such as from 8.53 to 8.54.

  2. To provide value transforms when data in the object needs to be adjusted in some way.

  3. To perform custom merging outside of merge groups.

This transform is applied prior to compare, validate or copy from file time on the newer release. The ADS and record definitions of both the newer and older release must be present.

The transform is implemented in the CustomTransform method. See CustomTransform

From File Custom Merging

This is for adjusting the automated merging performed when merge groups are present. Attribute values that are in a merge group are, by default, merged to the source from the target. However, there may be additional adjustments that need to be made to the object to assure the object has consistent data. In some cases other objects in the same FAMILY may also be adjusted at this time.

The transform is implemented in the CustomMerge method. See CustomMerge

Syntax

CustomValidate(&ADSRowset, &ADSName, &CompareType) 

Description

Implemented by object owners to provide custom validation logic.

Parameters

Parameter

Description

&ADSRowset

Specifies the current in-memory data set instance as a rowset object.

&ADSName

Specifies the ADS name as a string.

&CompareType

Specifies the compare type as integer:

  • 4 indicates premerge validation

  • 1 indicates post merge validation

  • 6 indicates Check DB Integrity

The premerge validation is performed only if there are merge groups in the data set.

Returns

Integer.

Syntax

DoTransform(&AdsNameArray)

Description

Implemented by object owners to provide custom copy to file transform, often to an older PeopleTools release.

Parameters

Parameter

Description

&ADSNameArray

AdsNameArray is an array of ADSM:AdsNameRowset.

An ADSM:AdsNameRowset is a (data set name, data set rowset) pair. When the function is called, this array will contain a single ADS instance in the form of the newer release. On return this array will contain 0 or more rowsets in the form of the target release. There can be more that one output rowset if the data set in one release was represented as several data sets in another release. There would be no rowsets in the array on return if the data set definition did not exist in the older release.

The target release is passed as a property named TargetRelease to the AdsValidationBase constructor – this can be used to determine what transform to apply.

Returns

Integer.

Syntax

CustomTransform(&ADSRowset,&ADSName)

Description

Implemented by object owners to provide custom transform logic at compare, validate or copy from file time.

Parameters

Parameter

Description

&ADSRowset

Specifies the current in-memory data set instance as a rowset.

&ADSName

Specifies the ADS name as a string.

Returns

Integer.

Syntax

CustomMerge(&ADSRowset,&ADSName,&CompareType)

Description

This method is implemented by object owners to provide custom merge logic. If merge groups are present in the data set, then prior to compare, validate and copy each instance in the source project file is copied to memory, and the corresponding target is also copied into memory. The merge groups attributes from the in-memory source rowset are copied into the in-memory target rowset. The resulting rowset is then passed to CustomMerge to allow programmatic adjustments.

Parameters

Parameter

Description

&ADSRowset

Specifies the current in-memory data set instance as a rowset object.

&ADSName

Specifies the ADS name as a string.

&CompareType

Specifies the compare type as integer:

  • 4 indicates premerge

    The premerge call is called after the default merge has been performed but before compare is run and before the user modifies merge options.

  • 1 indicates post merge

    The post merge validation is executed after a user has changed the merge options and prior to copy.

The only To File process is Copy to File.

During copy to file the framework iterates over instances in the project, and for each instance calls the OnCopyToFile base class method. In turn, OnCopyToFile calls DoTransform. The base class DoTransform makes no changes, but if the derived class implements this method then the source object may change when copied to the project XML file.

The From File processes are Compare from File, Validate from File, Copy from File.

During From File processing the framework iterates over instances in the project, and for each instance calls the OnPreCopyCompare then OnPreUpdate base class methods. OnPreCopyCompare is implemented in the base class to make the roughly following preliminary calls:

  1. CustomTransform: any special from file transforms.

  2. Validate: standard validations of original source if DB Integrity or Validate is selected.

  3. CustomValidate: any special validations.

  4. Merge: perform default merge of merge groups. This includes a compare of original source object.

  5. CustomMerge: any special adjustments to merge.

  6. Compare: compare merged rowset if compare was requested and merging was performed.

  7. Validate and CustomValidate: validate merged rowset if validate was requested and merging was performed.

  8. Copy: if copy was requested. If compare was run, then the user’s compare selections will be honored.