<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contentHaul xmlns:a="http://www.appian.com/ae/types/2009">
    <rule>
        <name>${interface_taskReport_name}</name>
        <uuid>${interface_taskReport_uuid}</uuid>
        <description>${interface_taskReport_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!pagingInfo: #&quot;SYSTEM_SYSRULES_pagingInfo&quot;(startIndex: 1, batchSize: 25),
  local!sendingTask: false,
  local!sendTaskSuccess,
  local!toOrFrom: "my tasks",
  /* Retrieve data from the process report to use here */
  local!report: a!refreshVariable(
    value: a!queryProcessAnalytics(
      report: #&quot;${constant_processReport_uuid}&quot;,
      contextProcessModels: #&quot;${constant_sendTaskModel_uuid}&quot;,
      /* Filter for tasks assigned to the current user or sent by the current user.      *
       * c8 is the field that holds the assignee, c1 is the field that holds the sender. */
      query: #&quot;SYSTEM_SYSRULES_query&quot;(
        filter: #&quot;SYSTEM_SYSRULES_queryFilter&quot;(
          field: if(local!toOrFrom = &quot;my tasks&quot;, &quot;c8&quot;, &quot;c1&quot;),
          operator: &quot;=&quot;,
          value: loggedInUser()
        ),
        pagingInfo: local!pagingInfo
      )
    ),
    /* Retrieve the data each minute to display the latest tasks */
    refreshInterval: 1,
    /* Retrieves the data each time a new task is sent to display the latest tasks */
    refreshOnVarChange: local!sendTaskSuccess
  ),
  /* Retrieve record names to use on record links, because the process report only has record IDs */
  local!recordNames: #&quot;SYSTEM_SYSRULES_queryEntity_v2&quot;(
    entity: #&quot;${cdt_mainDseConstant_uuid}&quot;,
    query: #&quot;SYSTEM_SYSRULES_query&quot;(
      selection: #&quot;SYSTEM_SYSRULES_querySelection&quot;(
        columns: {
          #&quot;SYSTEM_SYSRULES_queryColumn&quot;(field: &quot;id&quot;),
          #&quot;SYSTEM_SYSRULES_queryColumn&quot;(field: &quot;${title_field_name}&quot;)
        }
      ),
      /* Filter to only retrieve records that have open tasks assigned to the current user.  *
       * c7 is the report field that holds record IDs, and the union() call removes          *
       * duplicates from the list.                                                           */
      filter: #&quot;SYSTEM_SYSRULES_queryFilter&quot;(
        field: &quot;id&quot;,
        operator: &quot;in&quot;,
        value: union(tointeger(index(local!report.data, &quot;c7&quot;, {})), tointeger({}))
      ),
      pagingInfo: #&quot;SYSTEM_SYSRULES_pagingInfo&quot;(startIndex: 1, batchSize: -1)
    ),
    fetchTotalCount: false
  ),
  {
    /* The first half of the interface shows the controls for sending tasks */
    #&quot;${interface_taskReport_sendTask_uuid}&quot;(
      sendingTask: local!sendingTask,
      sendTaskSuccess: local!sendTaskSuccess
    ),
    #&quot;SYSTEM_SYSRULES_ButtonLayout&quot;(
      showWhen: not(local!sendingTask),
      secondaryButtons: #&quot;SYSTEM_SYSRULES_ButtonWidget&quot;(
        label: &quot;${taskReport_sendNewTask}&quot;,
        value: true,
        saveInto: {
          local!sendingTask,
          a!save(local!sendTaskSuccess, null)
        }
      )
    ),
    /* The second half of the interface shows the tasks assigned to the current user */
    #&quot;SYSTEM_SYSRULES_radioButtonField&quot;(
      labelPosition: &quot;COLLAPSED&quot;,
      choiceLabels: {&quot;${taskReport_myTasks}&quot;, &quot;${taskReport_sentByMe}&quot;},
      choiceValues: {&quot;my tasks&quot;, &quot;sent by me&quot;},
      choiceLayout: &quot;COMPACT&quot;,
      value: local!toOrFrom,
      saveInto: local!toOrFrom
    ),
    #&quot;SYSTEM_SYSRULES_gridField_v3&quot;(
      labelPosition: &quot;COLLAPSED&quot;,
      rowHeader: 1,
      instructions: local!report.description,
      emptyGridMessage: if(
        local!toOrFrom = &quot;my tasks&quot;,
        &quot;${taskReport_emptyMyTasksMessage}&quot;,
        &quot;${taskReport_emptyMySentTasksMessage}&quot;
      ),
      data: local!report,
      columns: {
        a!forEach(
          items: local!report.columnConfigs,
          expression: #&quot;${interface_taskGridColumn_uuid}&quot;(
            columnConfig: fv!item,
            recordNames: local!recordNames.data,
            filterByRecord: false,
            toOrFrom: local!toOrFrom,
            currentPage: fv!currentPage
          )
        )
      },
      pagingSaveInto: local!pagingInfo
    )
  }
)</definition>
        <metadataExpr></metadataExpr>
        <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>
