Please rate how useful you found this document: 
Average: 1.3 (3 votes)

Report Table

The current methods implemented for report tables in the ProcessMaker API designer are listed below:

Report Table:

NameDescriptionType Value
rep_uidReport table UIDStringString
rep_tab_nameReport table nameString"name" or "pmt_NAME" (Text string)
rep_tab_dscReport table descriptionString"Description of Report Table" (Text String)
rep_tab_connectionConnection of the report table, possible values are: "workflow", "rp" and Database connectionsString"workflow" or "h348fd..." (Text String)
rep_tab_typeReport table type, possible values are: "NORMAL" or "GRID"String"NORMAL" ("NORMAL" and "GRID") (unique allowed values)
rep_tab_gridBase grid UID where the report table will be generatedInteger"tr8945m..." (String of 32 characters)
fieldsArray of the report table columnsArrayCheck the next fields
Field Variables
fld_dynField name from a DynaformString"Accepted" (Text String)
fld_nameField name for the table created in mysqlString"Accepted" (Text String)
fld_labelLabel name of the field for the GUI in PMString"Accepted" (Text String)
fld_typeField type in mysql, values: "BOOLEAN", "TINYINT", "SMALLINT", "INTEGER", "BIGINT", "DOUBLE", "FLOAT","REAL", "DECIMAL", "CHAR", "VARCHAR", "LONGVARCHAR", "DATE", "TIME", "DATETIME"String"VARCHAR" (String type mysql field)
fld_sizeField size in mysqlInteger"23" (Numeric)

Get Report Tables List: GET project/{prj_uid}/report-tables

Gets the list of Report Tables in a project.

GET /api/1.0/{workspace}/project/{prj_uid}/report-tables

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Result:

TypeDescription
arrayReturns an array of report table objects

Example:

Response

 200 (OK)
 Content-Type: application/json
 [
    {
        "rep_uid": "12965606852f8dcf2154e21097825813",
        "rep_tab_name": "PMT_EJEMPLO",
        "rep_tab_description": "My table description",
        "rep_tab_class_name": "PmtExample",
        "rep_tab_connection": "workflow",
        "rep_tab_type": "NORMAL",
        "rep_tab_grid": "",
        "rep_num_rows": 2,
        "fields":
        [
           {
               "fld_uid": "64688692552f8de120c57d0031739165",
               "fld_index": "0",
               "fld_name": "APP_UID",
               "fld_description": "APP_UID",
               "fld_type": "VARCHAR",
               "fld_size": "32",
               "fld_null": "0",
               "fld_auto_increment": "0",
               "fld_key": "1",
               "fld_foreign_key": "0",
               "fld_foreign_key_table": "",
               "fld_dyn_name": "",
               "fld_dyn_uid": "",
               "fld_filter": "0"
           }
        ]
     }
 ]

Get Report Table: GET project/{prj_uid}/report-table/{rep_uid}

Gets a specified Report Table.

GET /api/1.0/{workspace}/project/{prj_uid}/report-table/{rep_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
rep_uidStringReport table UID

Result:

TypeDescription
objectReturns a report table object

Example:

Response

 200 (OK)
 Content-Type: application/json
 [
    {
        "rep_uid": "12965606852f8dcf2154e21097825813",
        "rep_tab_name": "PMT_EJEMPLO",
        "rep_tab_description": "descripcion de la tabla",
        "rep_tab_class_name": "PmtEjemplo",
        "rep_tab_connection": "workflow",
        "rep_tab_type": "NORMAL",
        "rep_tab_grid": "",
        "rep_num_rows": 2,
        "fields":
        [
           {
               "fld_uid": "64688692552f8de120c57d0031739165",
               "fld_index": "0",
               "fld_name": "APP_UID",
               "fld_description": "APP_UID",
               "fld_type": "VARCHAR",
               "fld_size": "32",
               "fld_null": "0",
               "fld_auto_increment": "0",
               "fld_key": "1",
               "fld_foreign_key": "0",
               "fld_foreign_key_table": "",
               "fld_dyn_name": "",
               "fld_dyn_uid": "",
               "fld_filter": "0"
           }
        ]
     }
 ]

Populate Report Table: GET project/{prj_uid}/report-table/{rep_uid}/populate

Repopulates a Report Table with case data. This endpoint deletes the contents of a specified Report Table and then refills it with data from the cases. This endpoint can be called if the data in a Report Table gets out of sync with the data from the cases.

GET /api/1.0/{workspace}/project/{prj_uid}/report-table/{rep_uid}/populate

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
rep_uidStringReport table UID

Result:

TypeDescription
emptyNo return

Example:

Response

 200 (OK)

Get Report Table Data: GET project/{prj_uid}/report-table/{rep_uid}/data

Gets the data from a Report Table. Returns all the rows in a Report Table and a count of the number of rows.

GET /api/1.0/{workspace}/project/{prj_uid}/report-table/{rep_uid}/data

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
rep_uidStringReport table UID

Result:

TypeDescription
objectReturns an object containing data about the report table

Example:

Response

 200 (OK)
 Content-Type: application/json
 {
     "rows": [
        {
            "app_uid":    "16154487852d6e4a63e8974075801312",
            "app_number": "652",
            "app_status": "DRAFT",
            "name":       "Jane Doe",
            "address":    "2132 W. Oak Av.",
            "__index__":  "lqaeqZWWpJyooqbFmNGZ0aOnxpqlnKSdq5aanJajnqY"
        },
        {
            "app_uid": "29839101252b8a4f21dfb22075517639",
            "app_number": "647",
            "app_status": "DRAFT",
            "name":       "Joh Roe",
            "address":    "955 S. Birch St.",
            "__index__": "l6mlp5qTnJaioqbDms2Z1p+lxcjOl6Kdq5aXnZymoK0"
        }
     ],
     "count": 2
 }

Create Report Table: POST project/{prj_uid}/report-table

Creates a new Report Table.

Consideration:

  • Must send the whole new structure of the table. If the table would have field A, B, C and the update sends A, B, D then C column is removed and D column is added.
  • Must use fld_uid to update a field, if the property is not present in the field description it will be considered as a new field. Therefore, the previous field will be deleted and a new one will be created.
  • Must send at least one of the two options pmt_tab_dsc or fields otherwise the server will answer with status 400.
  • The table must have at least one primary key field, if not present the server will answer with status 400.
  • The field structure must be completed, if any field is not provided the endpoint will answer with status 400 and a message showing the field property that is missing, for example: if the fld_type is not provided the endpoint will answer 400 "The property fld_type is not defined for field {fld_name} " or If the fld_name is not provided then the message is 400 "The property fld_name must be provided for all fields"

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

POST /api/1.0/{workspace}/project/{prj_uid}/report-table

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Required Fields:

Name Type Description
rep_tab_name String Report table name
rep_tab_dsc String Report table description
rep_tab_connection String Report table connection, possible values: "workflow", "rp" and database connection
rep_tab_type String Report table type, possible values: "NORMAL" or "GRID"
rep_tab_grid String Base grid UID where the report table was generated.
fields Array Columns in the report table. Check their variables in the following table.

Inside "fields" parameter, these are the required variables:

Name Type Description
fld_name String This variable is for the name of the field.
fld_label String This variable is for the label of the field.
fld_description String This variable is for the description of the field.
fld_type String This variable is for the type of the field, if it could be a "String", "Integer", etc.
fld_size Integer This variable is for the size of the field.

If you send an empty array you will create a Report Table with the default columns, those are the following:

Response

  ...
    "fields": [
        {
            "fld_uid": "4337807815b699dfe7235f9040768634",
            "fld_index": "0",
            "fld_name": "APP_UID",
            "fld_description": "APP_UID",
            "fld_type": "VARCHAR",
            "fld_size": "32",
            "fld_null": "0",
            "fld_auto_increment": "0",
            "fld_key": "1",
            "fld_table_index": "0"
        },
        {
            "fld_uid": "2791806115b699dfe812da4020621359",
            "fld_index": "1",
            "fld_name": "APP_NUMBER",
            "fld_description": "APP_NUMBER",
            "fld_type": "INTEGER",
            "fld_size": "11",
            "fld_null": "0",
            "fld_auto_increment": "0",
            "fld_key": "0",
            "fld_table_index": "0"
        },
        {
            "fld_uid": "2456566415b699dfe8b5820080052075",
            "fld_index": "2",
            "fld_name": "APP_STATUS",
            "fld_description": "APP_STATUS",
            "fld_type": "VARCHAR",
            "fld_size": "10",
            "fld_null": "0",
            "fld_auto_increment": "0",
            "fld_key": "0",
            "fld_table_index": "0"
        }
    ]
  ...

These columns are APP_UID, APP_NUMBER and APP_STATUS and their purpose is the following:

  • APP_UID: The case's unique ID. This value is used to obteined the case information. This field can NOT be removed from the report table.
  • APP_NUMBER: The case number. Report tables use this value to relate the case information with an individual case. This field can NOT be removed from the report table.
  • APP_STATUS: The case status. This field can be removed from the report table if desired.

Optional Fields:

NameTypeDescription
rep_tab_class_nameStringThis is the name of the generated class. It is in relationship with the rep_tab_table.

Inside "fields" parameter, these are the optional variables:

Name Type Description
fld_null String This variable define if the column accepts null values.
fld_auto_increment String This variable define if the column will be auto-incrementing.
fld_key String This variable define if the column will be the primary key.
fld_table_index String This variable define if the column will be an index.

Result:

TypeDescription
objectReturns an object containing data about the new repot table.

Example:

Request

 Content-Type: application/json
 [
    {
        "rep_tab_name" : "PMT_TABLE_TEST",
        "rep_tab_dsc" : "test",
        "rep_tab_connection" : "workflow",
        "rep_tab_type" : "NORMAL",
        "rep_tab_grid" : "",
        "fields":
            [
                {
                    "fld_name": "Text1",
                    "fld_label": "Text1",
                    "fld_description": "Text1",
                    "fld_type": "VARCHAR",
                    "fld_size": 255
                 },
                 {
                     "fld_name" : "Text2",
                     "fld_label": "Text2",
                     "fld_description": "Text2",
                     "fld_type" : "INTEGER",
                     "fld_size" : 10
                 }
            ]
     }
 ]

Response

 201 (Created)
 {
    "rep_uid": "72024958352f8f4b5b29e68065335979",
    "rep_tab_name": "PMT_TABLE_TEST",
    "rep_tab_description": "test",
    "rep_tab_class_name": "PmtTableTest",
    "rep_tab_connection": "workflow",
    "rep_tab_type": "NORMAL",
    "rep_tab_grid": "",
    "rep_num_rows": 2,
    "fields": [
                {
                    "fld_uid": "43224891252f8f4b5b3e7d5064126010",
                    "fld_index": "0",
                    "fld_name": "APP_UID",
                    "fld_description": "APP_UID",
                    "fld_type": "VARCHAR",
                    "fld_size": "32",
                    "fld_null": "0",
                    "fld_auto_increment": "0",
                    "fld_key": "1",
                    "fld_foreign_key": "0",
                    "fld_foreign_key_table": "",
                    "fld_dyn_name": "",
                    "fld_dyn_uid": "",
                    "fld_filter": "0"
                },
                {
                    "fld_uid": "88732448352f8f4b5b54e40018186789",
                    "fld_index": "1",
                    "fld_name": "APP_NUMBER",
                    "fld_description": "APP_NUMBER",
                    "fld_type": "INTEGER"
                    "fld_size": "11",
                    "fld_null": "0",
                    "fld_auto_increment": "0",
                    "fld_key": "0",
                    "fld_foreign_key": "0",
                    "fld_foreign_key_table": "",
                    "fld_dyn_name": "",
                    "fld_dyn_uid": "",
                    "fld_filter": "0"
                },
                {
                    "fld_uid": "28542848352f8f4b5b66c73025097960",
                    "fld_index": "2",
                    "fld_name": "APP_STATUS",
                    "fld_description": "APP_STATUS",
                    "fld_type": "VARCHAR",
                    "fld_size": "10",
                    "fld_null": "0",
                    "fld_auto_increment": "0",
                    "fld_key": "0",
                    "fld_foreign_key": "0",
                    "fld_foreign_key_table": "",
                    "fld_dyn_name": "",
                    "fld_dyn_uid": "",
                    "fld_filter": "0"
                },
                {
                    "fld_uid": "46525369552f8f4b5b7ce74071402298",
                    "fld_index": "3",
                    "fld_name": "Texto1",
                    "fld_description": "Texto1",
                    "fld_type": "VARCHAR",
                    "fld_size": "32",
                    "fld_null": "1",
                    "fld_auto_increment": "0",
                    "fld_key": "0",
                    "fld_foreign_key": "0",
                    "fld_foreign_key_table": "",
                    "fld_dyn_name": "",
                    "fld_dyn_uid": "",
                    "fld_filter": "0"
                },
                {
                    "fld_uid": "85085540252f8f4b5b90f02097502798",
                    "fld_index": "4",
                    "fld_name": "Texto2",
                    "fld_description": "Texto2",
                    "fld_type": "INTEGER",
                    "fld_size": "10",
                    "fld_null": "1",
                    "fld_auto_increment": "0",
                    "fld_key": "0",
                    "fld_foreign_key": "0",
                    "fld_foreign_key_table": "",
                    "fld_dyn_name": "",
                    "fld_dyn_uid": "",
                    "fld_filter": "0"
                }
            ]
 }

Update Report Table: PUT project/{prj_uid}/report-table/{rep_uid}

Updates a specified Report Table.

Consideration:

  • Must send the whole new structure of the table. If the table would have field A, B, C and the update sends A, B, D then C column is removed and D column is added.
  • Must use fld_uid to update a field, if the property is not present in the field description it will be considered as a new field. Therefore, the previous field will be deleted and a new one will be created.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

PUT /api/1.0/{workspace}/project/{prj_uid}/report-table/{rep_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
rep_uidStringReport table UID

Required Fields:

NameTypeDescription
fieldsArrayColumns in the report table. Check their variables in the main table.

Optional Fields:

NameTypeDescription
rep_tab_dscStringReport table description

Result:

TypeDescription
emptyNo return

Example:

Request

{
    "rep_uid": "6856971805b63262ce8a6b1070282359",
    "rep_tab_name": "PMT_REVIEW_LOCAL_RPT",
    "rep_tab_dsc": "local review",
    "fields": [
        {
            "fld_uid": "8610454955b63262d023342039592785",
            "fld_index": "0",
            "fld_name": "APP_UID",
            "fld_label": "APP_UID",
            "fld_description": "APP_UID",
            "fld_type": "VARCHAR",
            "fld_size": "32",
            "fld_null": "0",
            "fld_auto_increment": "0",
            "fld_key": "1",
            "fld_table_index": "1"
        },
        {
            "fld_uid": "2156049915b63262d0ceb02039858713",
            "fld_index": "1",
            "fld_name": "APP_NUMBER",
            "fld_label": "APP_NUMBER",
            "fld_description": "APP_NUMBER",
            "fld_type": "INTEGER",
            "fld_size": "11"
        },
        {
            "fld_uid": "2938043115b63262d191b30050387593",
            "fld_index": "2",
            "fld_name": "APP_STATUS",
            "fld_label": "APP_STATUS",
            "fld_description": "APP_STATUS",
            "fld_type": "VARCHAR",
            "fld_size": "10"
        },
        {
            "fld_uid": "9133753205b63262d255841082276946",
            "fld_index": "3",
            "fld_name": "DEFINE_SELFVALUE",
            "fld_dyn": "DEFINE_SELFVALUE_OTHER",
            "fld_label": "DEFINE_SELFVALUE",
            "fld_description": "DEFINE_SELFVALUE",
            "fld_type": "VARCHAR",
            "fld_size": "255"
        },
        {
            "fld_uid": "9557141095b63262d319206093833203",
            "fld_index": "4",
            "fld_name": "DEFINE_SELFVALUE_LABEL",
            "fld_dyn": "DEFINE_SELFVALUE_LABELTEST",
            "fld_label": "DEFINE_SELFVALUE_LABEL",
            "fld_description": "DEFINE_SELFVALUE_LABEL",
            "fld_type": "VARCHAR",
            "fld_size": "255"
        }
    ]
}

Response

 200 (OK)

Delete a Report Table: DELETE project/{prj_uid}/report-table/{rep_uid}

Deletes a Report Table.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/project/{prj_uid}/report-table/{rep_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
rep_uidStringReport table UID

Result:

TypeDescription
emptyNo return

Example:

Response

 200 (OK)