GlideTransientDynamicAttribute : global
L’API GlideTransientDynamicAttribute permet d’accéder aux métadonnées d’attributs dynamiques temporaires.
Cette API fournit des méthodes qui vous permettent d’obtenir des valeurs d’attributs dynamiques temporaires qui sont ajoutées à un champ DynamicAttributeStore et non définies dans la table Attribut dynamique [dynamic_attribute]. Les attributs dynamiques transitoires sont tous traités comme des types de données Chaîne et n’ont pas de sys_id. Pour plus de détails sur les attributs dynamiques, consultez Schéma dynamique. Les mêmes méthodes sont également disponibles pour les attributs dynamiques dans l’API GlideDynamicAttribute : global .
Pour utiliser cette API et créer des attributs dynamiques, vous devez disposer du rôle dynamic_schema_writer. Pour lire des données dynamiques à l’aide de cette API, vous devez disposer du rôle dynamic_schema_reader.
GlideTransientDynamicAttribute : getGroupName()
Obtient la valeur de la propriété de nom de groupe d’un objet d’attribut dynamique transitoire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Chaîne | Valeur de la propriété nom de groupe de l’attribut dynamique transitoire. Voir aussi Create a dynamic attribute group. |
Dans l’exemple suivant, la valeur du nom du groupe d’objets d’attribut dynamique transitoire s’affiche sous la forme d’un a.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string
GlideTransientDynamicAttribute : getName()
Obtient la valeur de la propriété name d’un objet d’attribut dynamique temporaire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Chaîne | Valeur de la propriété nom de l’attribut dynamique transitoire. |
Dans l’exemple suivant, la valeur du nom d’objet d’attribut dynamique transitoire est affichée sous la forme b.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string
GlideTransientDynamicAttribute : getPath()
Obtient la valeur de la propriété path d’un objet d’attribut dynamique transitoire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Chaîne | Valeur du chemin d’accès de l’attribut dynamique transitoire. |
Dans l’exemple suivant, la valeur du chemin d’accès de l’objet d’attribut dynamique transitoire est affichée comme a->b.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string
GlideTransientDynamicAttribute : getSysId()
Obtient la valeur sys_id (non définie) d’un objet d’attribut dynamique transitoire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Chaîne | Si l’objet sélectionné est un attribut dynamique transitoire, le résultat n’est pas défini. Sinon, sys_id d’un attribut dynamique. |
Dans l’exemple suivant, la valeur de la sys_id de l’objet d’attribut dynamique transitoire est affichée comme nulle.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string
GlideTransientDynamicAttribute : getType()
Obtient la valeur de la propriété type d’un objet d’attribut dynamique transitoire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Chaîne | Valeur du type de données de l’attribut dynamique transitoire. Le type de données pour les attributs dynamiques transitoires est toujours chaîne. |
Dans l’exemple suivant, la valeur du type d’objet d’attribut dynamique transitoire s’affiche sous forme de chaîne.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string
GlideTransientDynamicAttribute : isTransient()
Indique si un objet est un attribut dynamique transitoire.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Booléen | Marqueur indiquant si un attribut dynamique est transitoire. Valeurs valides :
Remarque : La table Attribut dynamique [dynamic_attribute] est accessible en accédant à , en sélectionnant un groupe, puis en sélectionnant l’onglet Attributs dynamiques . |
Dans l’exemple suivant, la méthode isTransient() renvoie true pour l’objet transitoire.
var das = new GlideDynamicAttributeStore();
das.setDynamicAttributeValue('a->b', 5); // transient (adding here)
das.setDynamicAttributeValue('a->c', 10); // defined in dynamic_attribute table
var attributes = das.getDynamicAttributes();
gs.info(attributes);
for (var i = 0; i < attributes.length; i++) {
var attr = attributes[i];
gs.info("");
gs.info("[" + i + "].getPath() = " + attr.getPath());
gs.info("[" + i + "].getName() = " + attr.getName());
gs.info("[" + i + "].getGroupName() = " + attr.getGroupName());
gs.info("[" + i + "].getSysId() = " + attr.getSysId());
gs.info("[" + i + "].isTransient() = " + attr.isTransient());
gs.info("[" + i + "].getType() = " + attr.getType());
}
Sortie :
*** Script: a->c,a->b
*** Script:
*** Script: [0].getPath() = a->c
*** Script: [0].getName() = c
*** Script: [0].getGroupName() = a
*** Script: [0].getSysId() = 8bc411a94fc01210b8ddc0e552ce0b3c
*** Script: [0].isTransient() = false
*** Script: [0].getType() = integer
*** Script:
*** Script: [1].getPath() = a->b
*** Script: [1].getName() = b
*** Script: [1].getGroupName() = a
*** Script: [1].getSysId() = undefined
*** Script: [1].isTransient() = true
*** Script: [1].getType() = string