Define a Data Model in the Controller

The data model specifies the data to return and display in the chart. This needs to be defined in the controller.

The data model consists of a dataPayload object in the form:

$scope.chartModel1 = {
  "dataPayload" : {
    "query": {
      "filter": "",
      "area": "",
      "group":"",
      "category": {
        "attribute": "",
        "type": ""
      }
    },
    "options": ""
  }
};

where:

  • filter - A query string that restricts the amount of data returned for the chart. For information about valid query syntax, see Defining Query Filter Strings.
  • area - Specifies the type of information that is to be displayed in the chart. Must be one of the following:
    • WORK_ITEMS
    • PROCESS_TEMPLATES
    • PROCESS_INSTANCES
    • AUDIT
    • CASE_OBJECTS
  • group (optional; default = all audit data is returned) - This is an attribute to further separate the data in the chart. The attributes that can be specified depends on the type of data specified in the area attribute. See "Attributes" below.
  • category - This is an attribute/type pair that specifies the type of data to show in the chart.
    • attribute - The name of the attribute that contains the data used to construct the chart. The attributes that can be specified depends on the type of data specified in the area attribute. See "Attributes" below.
    • type - Type of data displayed in the chart. Currently, the only valid entry is COUNT (that is, the number of items specified by the other attributes).
  • options - Not currently used.

Attributes

Some of the parameters above require an attribute name. The allowable attributes depends on the type of data displayed in the chart. The following links provide lists of attributes for each type of data:

Example Data Model

The following is an example data model that charts process instance counts, arranged by status:

$scope.chartModel1 = {
  "dataPayload" : {
    "query": {
      "filter": "NOT (status in ('pi_cancelled','pi_failed','pi_completed'))",
      "area": "PROCESS_INSTANCES",
      "group":"status",
      "category": {
        "attribute": "processTemplateName",
        "type": "COUNT"
      }
    },
    "options": ""
  }
};