<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
    <rule>
        <name>${interface_attachmentsGrid_name}</name>
        <uuid>${interface_attachmentsGrid_uuid}</uuid>
        <description>${interface_attachmentsGrid_desc}</description>
        <parentUuid>${folder_rulesAndConstants}</parentUuid>
        <visibility>
            <advertise>false</advertise>
            <hierarchy>true</hierarchy>
            <indexable>true</indexable>
            <quota>false</quota>
            <searchable>true</searchable>
            <system>false</system>
            <unlogged>false</unlogged>
        </visibility>
        <definition>a!localVariables(
  local!oldAttachments: a!refreshVariable(
    value: if(
      or(isnull(ri!documents), count(ri!documents) &lt; 1),
      0,
      length(ri!documents)
    ),
    refreshOnReferencedVarChange: false
  ),
  {
    #&quot;SYSTEM_SYSRULES_gridLayout&quot;(
      height: &quot;SHORT&quot;,
      label: &quot;${attachmentsGrid_label}&quot;,
      rowHeader: 1,
      showWhen: or(not(ri!readOnly), and(not(isnull(ri!documents)), count(ri!documents) &gt; 0)),
      emptyGridMessage: &quot;${attachmentsGrid_emptyMessage}&quot;,
      headerCells: {
        #&quot;SYSTEM_SYSRULES_gridLayoutHeaderCell&quot;(label: &quot;${file}&quot;),
        #&quot;SYSTEM_SYSRULES_gridLayoutHeaderCell&quot;(label: &quot;${uploadedOn}&quot;, align: &quot;RIGHT&quot;),
        #&quot;SYSTEM_SYSRULES_gridLayoutHeaderCell&quot;(showWhen: or(isnull(ri!readOnly), not(ri!readOnly)))
      },
      columnConfigs: {
        #&quot;SYSTEM_SYSRULES_gridLayoutColumnConfig&quot;(weight: 7),
        #&quot;SYSTEM_SYSRULES_gridLayoutColumnConfig&quot;(weight: 3),
        #&quot;SYSTEM_SYSRULES_gridLayoutColumnConfig&quot;(width: &quot;ICON&quot;, showWhen: or(isnull(ri!readOnly), not(ri!readOnly)))
      },
      rows: a!forEach(
        items: ri!documents,
        expression: #&quot;${expRule_attachmentsGridRow_uuid}&quot;(
          attachment: fv!item,
          attachments: ri!documents,
          deletedAttachments: ri!deletedDocuments,
          index: fv!index,
          readOnly: ri!readOnly,
          oldAttachments: local!oldAttachments,
          target: ri!target
        )
      ),
      addRowLink: if(
        ri!readOnly,
        null,
        #&quot;SYSTEM_SYSRULES_dynamicLink&quot;(
          label: &quot;${attachmentsGrid_newFile}&quot;,
          value: todocument(null),
          saveInto: a!save(ri!documents, append(ri!documents, save!value))
        )
      )
    )
  }
)</definition>
        <namedTypedValue>
            <name>documents</name>
            <type>
                <name>CollaborationDocument?list</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>readOnly</name>
            <type>
                <name>boolean</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>target</name>
            <type>
                <name>CollaborationFolder</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>deletedDocuments</name>
            <type>
                <name>CollaborationDocument?list</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <preferredEditor>interface</preferredEditor>
        <offlineEnabled>false</offlineEnabled>
    </rule>
    <roleMap public="true">
        <role allowForAll="false" inherit="true" name="readers">
            <users/>
            <groups/>
        </role>
        <role allowForAll="false" inherit="true" name="authors">
            <users/>
            <groups/>
        </role>
        <role allowForAll="false" inherit="true" name="administrators">
            <users/>
            <groups/>
        </role>
        <role allowForAll="false" inherit="false" name="denyReaders">
            <users/>
            <groups/>
        </role>
        <role allowForAll="false" inherit="false" name="denyAuthors">
            <users/>
            <groups/>
        </role>
        <role allowForAll="false" inherit="false" name="denyAdministrators">
            <users/>
            <groups/>
        </role>
    </roleMap>
</contentHaul>
