---
sourceDocument: Référence de l’API Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - fr-FR

ft:publication_title :

    - Référence de l’API Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# WorkflowModelManagerAjax - Global

# WorkflowModelManagerAjax - Global {#ariaid-title1}

* Rversion finale: Xanadu
* 
* Mis à jour 1 août 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute de lecture

L'include de script WorkflowModelManagerAjax fournit une couche AjaxProcessor pour l'include de script WorkflowModelManager . Cette classe dérive de AbstractAjaxProcessor.

Utilisez cette classe dans les menus contextuels de Débogage de workflow.

## WorkflowModelManagerAjax : getExecutedHistory( ) {#ariaid-title2}

Place l'historique des exécutions dans le paramètre de retour en fonction de la chaîne de requête.
{#r_WFMMA-getExecutedHistory__table_tgk_kpt_st__entry__3}

| Nom | Type | Description |
|-|-|-|
| Aucun |   |   |
[Tableau 1. Paramètres]

{#r_WFMMA-getExecutedHistory__table_tgk_kpt_st} {#r_WFMMA-getExecutedHistory__table_ugk_kpt_st__entry__2}

| Type | Description |
|-|-|
| nul |   |
[Tableau 2. Renvoie]

{#r_WFMMA-getExecutedHistory__table_ugk_kpt_st}

## WorkflowModelManagerAjax : getFinalExecutedActivityIdList( ) {#ariaid-title3}

Renvoie la liste des activités d'exécution finale en fonction d'une chaîne de requête.
{#r_WFMMA-gtFnlExexActivIdLst__table_xgk_kpt_st__entry__3}

| Nom | Type | Description |
|-|-|-|
| Aucun |   |   |
[Tableau 3. Paramètres]

{#r_WFMMA-gtFnlExexActivIdLst__table_xgk_kpt_st} {#r_WFMMA-gtFnlExexActivIdLst__table_ygk_kpt_st__entry__2}

| Type | Description |
|-|-|
| nul |   |
[Tableau 4. Renvoie]

{#r_WFMMA-gtFnlExexActivIdLst__table_ygk_kpt_st}  
Cet exemple montre comment obtenir le sys_ids d'une liste d'activités exécutée.

    var model = new WorkflowModelManagerAjax(); // Initiate the class

      model.getParameter = function(paramName) {
        return {
           sysparm_key_id: "0213a4a607e0011094b4fe4f7c1ed0e2", // sys_id of workflow context
           sysparm_key_table: 'wf_context'
        }[paramName];
      } // Override the parameters while calling from server side

      model.getExecutedHistory();
      var finals = model.getFinalExecutedActivityIdList(); // Get the list of IDs
      finals = JSON.parse(finals);
      var finalarrofID = finals.ids;
        for ( var x = 0; x < finalarrofID .length; x++ ) {
          gs.print(JSON.stringify(finalarrofID[x]) ); // Print the sys_ids of workflow history records
        }

Sortie :

    WorkflowModelManagerAjax: creating new WorkflowModelManager for context=0213a4a607e0011094b4fe4f7c1ed0e2
    WorkflowModelManagerAjax: returning 4 ActivityHistoryRecords
    WorkflowModelManagerAjax: returning 4 activities  in execution path for 0213a4a607e0011094b4fe4f7c1ed0e2
    *** Script: "0a13a4a607e0011094b4fe4f7c1ed0e3"
    *** Script: "d61368a607e0011094b4fe4f7c1ed027"
    *** Script: "de1368a607e0011094b4fe4f7c1ed02b"
    *** Script: "961368a607e0011094b4fe4f7c1ed02f"

## WorkflowModelManagerAjax : getRolledBackActivityIdList( ) {#ariaid-title4}

Place la liste d'activités de restauration dans le paramètre de retour en fonction de la chaîne de requête.
{#r_WFMMA-gtRolledBackActivityIdLst__table_vgk_kpt_st__entry__3}

| Nom | Type | Description |
|-|-|-|
| Aucun |   |   |
[Tableau 5. Paramètres]

{#r_WFMMA-gtRolledBackActivityIdLst__table_vgk_kpt_st} {#r_WFMMA-gtRolledBackActivityIdLst__table_wgk_kpt_st__entry__2}

| Type | Description |
|-|-|
| nul |   |
[Tableau 6. Renvoie]

{#r_WFMMA-gtRolledBackActivityIdLst__table_wgk_kpt_st}

