OpenWGA 7.5 - OpenWGA Concepts and Features

Design and development » HDBModel framework » HDBModel in TMLScript » The "HDBModel" object

Using the custom parameter

One parameter on HDBModelParams object has no predefined meaning and may be used by the designer for any custom purpose. This is hdbModelParams.customParam which may take an object of any type (including collections like Lists and Lookup table to pass multiple objects).

You could use it for varying reasons, for example:

  • Give some data into the create/update/delete process "from the outside" that should be processed some event script or update process
  • Use it inside your event scripts to transport data between events. You could collect some data in one event, store it on the custom parameter and retrieve it in a later script.

Referring to the example from Using update processes we may create another custom process named "assignToUser.tmlscript", where we do not use the currently logged in user but a user name we pass into the process as custom parameter. There is a HDBModel.updateContent() variant taking the content to update, the update module to execute plus the custom parameter directly as arguments:

HDBModel.updateContent(content(), "assignToUser", "ow");

A TMLScript module running as HDBModel update process receives the HDBModelParams object that was passed to the operation as variable "hdbParams". There the process can retrieve the given user name to use it.

content().setItemValue("assignedto", hdbParams.customParam);

content().setItemValue("status", "inprogress");