Data objects and scriptability

Scriptability is the ability of code to set (write) or get (read) a scriptable item such as a property (column) on an entity. To do so, you set the following attributes:

  • getterScriptability
  • setterScriptabiliy

The following table lists the different types of scriptability:

Type

Description

all

Exposed in Gosu, wherever Gosu is valid, for example, in rules and PCF files

doesNotExist

Not exposed in Gosu

hidden

Not exposed in Gosu

If you do not specify a scriptability annotation, then PolicyCenter defaults to a scriptability of all.

Important: There are subtle differences in how PolicyCenter treats entities and fields marked as doesNotExist and hidden. However, these differences relate to internal PolicyCenter code. For your purpose, these two annotations behave in an identical manner, meaning any entity or field that uses one of these annotations does not show in Gosu code. In general, there is no need for you to use either one of these annotations.

Scriptability behavior on entities

If you set setterScriptability at the entity level but you also set the value to hidden or doesNotExist, then PolicyCenter does not generate constructors for the entity. In essence, you cannot create a new instance of the entity in Gosu. Within the PolicyCenter data model, you can set the following scriptability annotation on <entity> objects:

Object

Set (write)

Get (read)

<entity>

Yes

No*

* <entity> does not contain a getterScriptability attribute.

Scriptability behavior on fields (columns)

If you set setterScriptability at the field level, then the value that you set controls the writability of the associated property in Gosu. Within the PolicyCenter data model, you can set the following scriptability annotation on fields on <entity> objects:

Field

Set (write)

Get (read)

<array>

Yes

Yes

<column>

Yes

Yes

<edgeForeignKey>

Yes

Yes

<foreignkey>

Yes

Yes

<onetoone>

Yes

Yes

<typekey>

Yes

Yes