Источник:
https://ievgensaxblog.wordpress.com/...via-extension/
==============
Quite a while ago I wrote a blog post about
postTargetProcess method that could be added to a data entity for post processing. Previously, you could add it only to a newly created entity, but now you can extend any entity using CoC.
This method is a bit special because it is not declared on the parent object, but is called via reflection by DMFEntityBase class. Full list of method that work in the same way:
- defaultCTQuery
- copyCustomStagingToTarget
- postGetStagingData
- preTargetProcessSetBased
- postTargetProcess
DMFEntityBase uses
tableHasStaticMethod() to check if a method is defined and
DictDataEntity.callStatic() to call it. In the latest PUs Microsoft added support of CoC methods to Dict* API and reflection methods, so now it is possible to use CoC method in this scenario as well.
Extension is quite simple and straightforward, all you need to do is to declare static method with respective signature and
do not call next because this method is not defined on the parent object:
[ExtensionOf(tableStr(MyDataEntity))]final public class MyDataEntity_Extension{ public static void postTargetProcess(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution) { //do stuff }}
Источник:
https://ievgensaxblog.wordpress.com/...via-extension/