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:
getterScriptabilitysetterScriptabiliy
The following table lists the different types of scriptability:
Type |
Description |
|---|---|
|
Exposed in Gosu, wherever Gosu is valid, for example, in rules and PCF files |
|
Not exposed in Gosu |
|
Not exposed in Gosu |
If you do not specify a scriptability
annotation, then PolicyCenter
defaults to a scriptability of all.
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) |
|---|---|---|
|
Yes |
No* |
* |
||
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) |
|---|---|---|
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
