{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1127,"path":"api-reference/server-api-reference/c_WorkflowModelManagerAjaxAPI.md","title":"WorkflowModelManagerAjax - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# WorkflowModelManagerAjax- Global\n\nThe WorkflowModelManagerAjax script include provides an AjaxProcessor wrapper for the WorkflowModelManager script include. This class derives from AbstractAjaxProcessor.\n\nUse this class in the Workflow Debug context menus.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## WorkflowModelManagerAjax - getExecutedHistory\\( \\)\n\nPuts the execution history into the return parameter based on the query string.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## WorkflowModelManagerAjax - getFinalExecutedActivityIdList\\( \\)\n\nReturns the final execution activity list based on a query string.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\nThis example shows how to obtain the sys\\_ids of an executed activity list.\n\n```\nvar model = new WorkflowModelManagerAjax(); // Initiate the class\n\n  model.getParameter = function(paramName) {\n    return {\n       sysparm_key_id: \"0213a4a607e0011094b4fe4f7c1ed0e2\", // sys_id of workflow context\n       sysparm_key_table: 'wf_context'\n    }[paramName];\n  } // Override the parameters while calling from server side\n\n  model.getExecutedHistory();\n  var finals = model.getFinalExecutedActivityIdList(); // Get the list of IDs\n  finals = JSON.parse(finals);\n  var finalarrofID = finals.ids;\n    for ( var x = 0; x < finalarrofID .length; x++ ) {\n      gs.print(JSON.stringify(finalarrofID[x]) ); // Print the sys_ids of workflow history records\n    }\n```\n\nOutput:\n\n```\nWorkflowModelManagerAjax: creating new WorkflowModelManager for context=0213a4a607e0011094b4fe4f7c1ed0e2\nWorkflowModelManagerAjax: returning 4 ActivityHistoryRecords\nWorkflowModelManagerAjax: returning 4 activities  in execution path for 0213a4a607e0011094b4fe4f7c1ed0e2\n*** Script: \"0a13a4a607e0011094b4fe4f7c1ed0e3\"\n*** Script: \"d61368a607e0011094b4fe4f7c1ed027\"\n*** Script: \"de1368a607e0011094b4fe4f7c1ed02b\"\n*** Script: \"961368a607e0011094b4fe4f7c1ed02f\"\n\n```\n\n## WorkflowModelManagerAjax - getRolledBackActivityIdList\\( \\)\n\nPuts the rollback activity list into the return parameter based on the query string.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n"}}