OpenWGA 7.9 - TMLScript reference

HDBModelParams
Property :

process

On object HDBModelParams
Usage A custom process to run on create or update
Description

This may be a JavaScript function, getting two parameters:

  • The content that is created/updated
  • A Lookup table of process parameters given by the HDBModel. Currently it only contains one entry of key "hdbParams", containing the HDBModelParams object passed to the operation

Alternatively you can use method hdbModelParams.setUpdateModuleProcess() to let the process execute code in a TMLScript module.

Valid for operations:

  • create (optional)
  • update (optional)
Writable True
Return value A process object of varying type.
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Running a JavaScript function as update process:

var params = HDBModel.newUpdateContentParams(content());
params.process = function(con, params) {
   con.setItemValue("updated", true);

   ...
};
HDBModel.updateContent(params);