A M2MExportRuleset can be extended by pre-process and post-process JSFunctions.
The pre-process JSFunction is executed by the M2M Engine at the beginning of the transformation, just before the ExportMappingRules are applied.
The post-process JSFunction is executed by the M2M Engine at the end of the transformation, just after the ExportMappingRules are applied.
The JSFunction used as pre-process or post-process must not have any arguments, and if it returns a Variable, it will not be used by the M2M Engine. These JSFunction must be linked to the M2MExportRuleset via the Dependencies preProcessRuleset and postProcessRuleset
To proceed, right-click on the M2MExportRuleset, and click on Add new | M2M | preProcessRuleset or Add new | M2M | postProcessRuleset:
After clicking, a dialog window is displayed to select the JSFunction as pre-process or post-process:
Once the M2MExportRuleset is linked to its pre-process and post-process JSFunctions, it looks like below: