--- title: "Post Agreement Revise" slug: "post-agreement-revise" description: "Use this extension point to run a script to execute custom actions when users revise a published agreement." updated: 2026-06-02T13:24:34Z published: 2026-06-02T13:24:34Z canonical: "docs.zilliant.com/post-agreement-revise" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt > Use this file to discover all available pages before exploring further. # Post Agreement Revise ## Purpose Allows you to run a script to execute custom actions when users [revise a published agreement](/v1/docs/manage-published-agreements#revise-agreements). ## Setup Upload the script for **Post Agreement Revise**. For details about uploading and configuring Groovy scripts, read [Upload a Groovy script](/docs/upload-a-groovy-script). ## Binding variables In addition to the [common binding variables](/docs/binding-variables), the following binding variables are available for this extension point. | Variable name | Class | Description | | --- | --- | --- | | salesItemsTree | SalesItemsTree | Represents the Quote object associated with the agreement under negotiation. Contains functions you can use to query and modify the header and its line items. | | agreement | Agreement | Represents the agreement. Contains functions you can use to query and modify the agreement. This variable can’t modify data. Use it only to retrieve information from the agreement. | | agreementHeader | AgreementHeader | Represents the AgreementHeader object. Contains functions you can use to query and modify the agreement and its line items. This variable can’t modify data. Use it only to retrieve information from the agreement. | | accountInfo | AccountInfo | Represents the AccountInfo object. Contains details of the linksAgreementAccount. | | accountPFRecords | List | List of PartnerFunctionRecord objects. Represents partner function records of the linked account. | | sourceAgreementPFRecords | Collection | Collection of PartnerFunctionRecord objects. Contains a list of objects representing partner function records of the source Quote object associated with the agreement under negotiation. | For details about the classes listed in this table, including available methods, fields, and method signatures, read the [Zilliant Groovy API reference](/main/docs/groovy-api-reference). ## Expected output No output expected. ## Script execution A script that you upload for this extension point runs automatically when users [revise a published agreement](/v1/docs/manage-published-agreements#revise-agreements). If you use the `salesItemsTree` variable in the script to modify the agreement data, the system applies changes to the Quote object associated with the agreement under negotiation. If no script is uploaded for this extension point, the system creates agreement revisions without additional action. ## Sample script ```groovy import com.imc.vocabulary.Schema import com.imc.iss.groovy.agreements.Agreement import com.imc.iss.groovy.agreements.AgreementHeader import com.imc.iss.groovy.agreements.AgreementLine import com.imc.iss.groovy.salesitem.SalesItemsTree import com.imc.iss.groovy.salesitem.SalesItemNode // Script Execution: SalesItemsTree Started System.out.println('Script Execution: SalesItemsTree Started') // Get the quote title and URI def quoteTitle = salesItemsTree.getQuoteDataAttributeValue(Schema.objectName.getUriAsString()) System.out.println('Agreement Quote URI: ' + salesItemsTree.getQuoteURI()) System.out.println('Agreement Quote Title: ' + quoteTitle) // Set the updated quote title with prefix salesItemsTree.setQuoteDataAttribute(Schema.objectName.getUriAsString(), quoteTitle + ' - SalesItemsTree') System.out.println('Added prefix SalesItemsTree in Quote Title') // Script Execution: AgreementHeader Completed System.out.println('Script Execution: AgreementHeader Completed') // Doubling the Policy Value at All Levels of a SalesItemNode: Started System.out.println('Doubling the Policy Value at All Levels of a SalesItemNode: Started') // Iterate through each SalesItemNode and double the policy value for (SalesItemNode salesItemNode: salesItemsTree.getChildren()) {    doublePolicyValue(salesItemNode) } // Method to double the policy value of a SalesItemNode void doublePolicyValue(SalesItemNode salesItemNode) {    def position = salesItemNode.getSalesItemDataAttributeValue(Schema.salesItemPosition.getUriAsString())    def policyValue = salesItemNode.getSalesItemDataAttributeValue(Schema.agreementPolicyValue.getUriAsString())    salesItemNode.setDataAttribute(Schema.agreementPolicyValue.getUriAsString(), 2 * policyValue)    System.out.println('Policy Value at ' + position + ' : ' + policyValue)    // Recursively double the policy value for child nodes    List < SalesItemNode > salesItemNodes = salesItemNode.getChildren()    for (SalesItemNode child: salesItemNodes) {        doublePolicyValue(child)    } } // Doubling the Policy Value at All Levels of a SalesItemNode: Completed System.out.println('Doubling the Policy Value at All Levels of a SalesItemNode: Completed') // Accessing all AgreementLine URIs System.out.println('Accessing all AgreementLine URIs') // Iterate through each AgreementLine and access its URI for (AgreementLine agreementLine: agreementHeader.getAgreementLines()) {    accessAgreementLines(agreementLine) } // Method to recursively access all AgreementLine URIs void accessAgreementLines(AgreementLine agreementLine) {    System.out.println('URI: ' + agreementLine.getAgreementLineURI())    List < AgreementLine > agreementLines = agreementLine.getAgreementLines()    for (AgreementLine child: agreementLines) {        accessAgreementLines(child)    } } // Script Execution Completed System.out.println('Script Execution Completed') // Return the agreement object return agreement ```