---
sourceDocument: Referência de API do Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# WorkflowModelManagerAjax - Global

# WorkflowModelManagerAjax - Global {#ariaid-title1}

* Versão de lançamento: Xanadu
* 
* Atualizado 1 de ago. de 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

A inclusão de script WorkflowModelManagerAjax fornece um wrapper AjaxProcessor para a inclusão de script WorkflowModelManager. Esta classe deriva de AbstratAjaxProcessor.

Use esta classe nos menus de contexto de Depuração de fluxo de trabalho.

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

Coloca o histórico de execução no parâmetro de retorno com base na cadeia de caracteres de consulta.
{#r_WFMMA-getExecutedHistory__table_tgk_kpt_st__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 1. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 2. Retorna]

{#r_WFMMA-getExecutedHistory__table_ugk_kpt_st}

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

Retorna a lista de atividades de execução final com base em uma cadeia de caracteres de consulta.
{#r_WFMMA-gtFnlExexActivIdLst__table_xgk_kpt_st__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 3. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 4. Retorna]

{#r_WFMMA-gtFnlExexActivIdLst__table_ygk_kpt_st}  
Este exemplo mostra como obter os sys_ids de uma lista de atividades executadas.

    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
        }

Saída:

    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}

Coloca a lista de atividades de reversão no parâmetro de retorno com base na cadeia de caracteres de consulta.
{#r_WFMMA-gtRolledBackActivityIdLst__table_vgk_kpt_st__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 5. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 6. Retorna]

{#r_WFMMA-gtRolledBackActivityIdLst__table_wgk_kpt_st}

