<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
    <rule>
        <name>${expRule_makeActivityCDT_name}</name>
        <uuid>${expRule_makeActivityCDT_uuid}</uuid>
        <description>${expRule_makeActivityCDT_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>'type!{${cdt_namespace}}${cdt_activity_name}'(
  recordId: ri!recordId,
  who: ri!who,
  action: ri!action,
  /* Use a different Details pattern for each type of activity */
  details:if(
    ri!action = cons!${constant_actionSent_name},
    ${activityHistory_to} &amp; char(10) &amp; ${activityHistory_details} &amp; if(
      isnull(ri!taskDeadline),
      &quot;&quot;,
      char(10) &amp; ${activityHistory_deadline}
    ),
    if(
      or(ri!action = cons!${constant_actionCompleted_name}, ri!action = cons!${constant_actionSkipped_name}),
      ${activityHistory_fromUser} &amp; char(10) &amp; if(isnull(ri!comments), &quot;${activityHistory_noComments}&quot;, ${activityHistory_comments}),
      if(
        ri!action = cons!${constant_actionSendMessage_name},
        ${activityHistory_message} &amp; if(not(isnull(ri!attachment)), char(10) &amp; ${activityHistory_attachment}, &quot;&quot;),
        if(
          or(ri!action = cons!${constant_actionCreate_name}, ri!action = cons!${constant_actionUpdate_name}),
          #&quot;${expRule_updateMessage_uuid}&quot;(
            oldCDT: ri!oldCDT,
            newCDT: ri!newCDT,
            fields: cons!${constant_recordFieldNames_name},
            fieldNames: cons!${constant_recordFieldDisplayNames_name},
            fieldTypes: cons!${constant_recordFieldTypes_name}
          ) &amp; if(
            or(isnull(ri!newDocs), count(ri!newDocs)=0),
            &quot;&quot;,
            ${activityHistory_attachedFiles} &amp; char(10)
          ) &amp; if(
            or(isnull(ri!deletedDocs), count(ri!deletedDocs)=0),
            &quot;&quot;,
            ${activityHistory_deletedFiles}
          ),
          &quot;${activityHistory_noActivityFound}&quot;
        )
      )
    )
  ),
  when: now()
)</definition>
        <namedTypedValue>
            <name>recordId</name>
            <type>
                <name>int</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>who</name>
            <type>
                <name>User</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>action</name>
            <type>
                <name>string</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
            <value/>
        </namedTypedValue>
        <namedTypedValue>
            <name>taskAssignee</name>
            <type>
                <name>User</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>taskAssigner</name>
            <type>
                <name>User</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>taskDetails</name>
            <type>
                <name>string</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
            <value/>
        </namedTypedValue>
        <namedTypedValue>
            <name>taskDeadline</name>
            <type>
                <name>dateTime</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>comments</name>
            <type>
                <name>string</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
            <value/>
        </namedTypedValue>
        <namedTypedValue>
            <name>message</name>
            <type>
                <name>string</name>
                <namespace>http://www.w3.org/2001/XMLSchema</namespace>
            </type>
            <value/>
        </namedTypedValue>
        <namedTypedValue>
            <name>attachment</name>
            <type>
                <name>CollaborationDocument</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>oldCDT</name>
            <type>
                <name>${cdt_main_name}</name>
                <namespace>${cdt_namespace}</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>newCDT</name>
            <type>
                <name>${cdt_main_name}</name>
                <namespace>${cdt_namespace}</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>newDocs</name>
            <type>
                <name>CollaborationDocument?list</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <namedTypedValue>
            <name>deletedDocs</name>
            <type>
                <name>CollaborationDocument?list</name>
                <namespace>http://www.appian.com/ae/types/2009</namespace>
            </type>
        </namedTypedValue>
        <preferredEditor>legacy</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>
