{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":951,"path":"api-reference/server-api-reference/c_AbstractReconciler.md","title":"AbstractReconciler - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# AbstractReconciler- Global\n\nThe AbstractReconciler script include provides methods to use as a base class to create your own Discovery reconciler.\n\nThis is an abstract base class for reconciling newly discovered data in an XMLMemoryTable to a related list in the database. The AbstractReconciler script include implements the common logic and helper methods for reconciling related lists for a particular CMDB item against discovered information present in a MemoryTable instance.\n\nMost of this logic is very straightforward, but one bit may not be: the resolution of references to previously reconciled records. This feature works by collecting information while reconciling one related list, then passing that information on to the reconciler for another related list. For example, while switch partitions are being reconciled, information is gathered \\(in a map instance\\) that maps an interface number for a partition to the sys\\_id of the partition's record in the partition table. Then later when the switchports are being reconciled, a reference to the switch partition that contains the switchport can be resolved by using this map.\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## AbstractReconciler - getReconciliationField\\(\\)\n\nDetermines if the newly discovered data is different than the data already in the database for the current item.\n\nThis method is only invoked for items that have been rediscovered.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Boolean|True if the data has changed.|\n\n## AbstractReconciler - getReconciliationKey\\(\\)\n\nGets the string value of the field to be used as a key to look up a record in the newly discovered data.\n\nThis value will be used to attempt to find a record in the discovered data, using the column returned by the getReconciliationKey\\(\\) method.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Value to use as a key into the discovered data.|\n\n## AbstractReconciler - hasChanged\\(\\)\n\nReturns true if the newly discovered data is different than the data already in the database for this item.\n\nThis method is only invoked for items that have been rediscovered.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Boolean|True if the discovered data is different than the data already in the database.|\n\n## AbstractReconciler - markAbsent\\(\\)\n\nMarks CIs as absent by setting the install status to \"Absent\"; other tables are marked by setting the \\(presumed present\\) field \"absent\" to true.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - markPresent\\(\\)\n\nMarks CIs as present by setting the install status to \"Installed\"; other tables are marked by setting the \\(presumed present\\) field \"absent\" to false.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - process\\(\\)\n\nReconciles the newly discovered data with the data already present in the database and resolves references to previously reconciled data.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - readDatabaseFields\\(\\)\n\nReads the current memory table record of newly discovered data and checks its validity.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Boolean|True if the data is valid.|\n\n## AbstractReconciler - readDiscovered\\(\\)\n\nReads the current memory table record of newly discovered data and checks its validity.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Boolean|True if the data is valid.|\n\n## AbstractReconciler - resolveReferenceFields\\(\\)\n\nReads the fields in the current database record into instance member fields.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - setDatabaseFields\\(\\)\n\nSets the database fields for the current record to the values in the newly discovered information.\n\nThis method is invoked both for new database records and for existing database records when the discovered data has changed.\n\nMandatory method, must be overridden in all concrete subclasses.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - setup\\(\\)\n\nOptional override for concrete subclasses that require special setup.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## AbstractReconciler - track\\(String sys\\_id\\)\n\nOptional method to override in concrete subclasses that need to resolve reference fields.\n\nThis method is invoked after valid discovered data is read. Generally implementations will use some of this discovered data as a key into a map \\(passed into the concrete reconciler class when it was instantiated\\) that will return the sys\\_id of the database record holding the referenced information. However, implementations are not required to use this approach.\n\n|Name|Type|Description|\n|----|----|-----------|\n|sys\\_id|String|The sys\\_id of the current database record.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n"}}