Documentation

Stage

Scope: catalog Permissions: all

You can find more details in RPA module documentation.

rpa.stage.*

Method Description Available from version
rpa.stage.get({id: number}) Passes information about stage using its ID Parameter:
  • id - stage ID

Response:

{
    "id": 1,
    "name": "Start",
    "code": "",
    "color": "22B9FF",
    "sort": 1000,
    "semantic": null,
    "typeId": 1,
    "isFirst": true,
    "isSuccess": false,
    "isFail": false,
    "tasks": [
        {
            "title": "Task",
            "robotType": "RpaApproveActivity",
            "robotName": "A43555_78925_98855_46118",
            "canAppendResponsibles": true,
            "users": [
                {
                    "id": "U1",
                    "entityId": 1,
                    "name": "Anton",
                    "photoSrc": "",
                    "url": "\\/company\\/personal\\/user\\/1\\/",
                    "entityType": "users"
                },
                {
                    "id": "U4",
                    "entityId": 4,
                    "name": "Piter",
                    "photoSrc": "",
                    "url": "\\/company\\/personal\\/user\\/4\\/",
                    "entityType": "users"
                }
            ]
        }
    ],
    "robotsCount": 0,
    "possibleNextStages": [1,2,3,4,5],
    "permissions": {
        "droppable": true,
        "canMoveFrom": true
    }
}
  • name - stage name
  • code - symbol code. Can be used as external identifier
  • color - color stage HEX code, 6 characters
  • sort - sort index
  • semantic - stage semantics code. Can be either SUCCESS, or FAIL
  • typeId - process identifier
  • isFirst - calculated field. true when it is process first stage
  • isSuccess - calculated field. true when this stage is successful
  • isFail - calculated field. true when this stage failed
  • tasks - array of stage tasks. Each record has the following structure:
    • title - task title
    • robotType - task type. Can accept one of the following values:
      • RpaApproveActivity - approve or deny
      • RpaMoveActivity - move
      • RpaRequestActivity - data request
      • RpaReviewActivity - mark as read
    • robotName - activity name
    • users - array of task participants (for rendering in kanban at the stage)
  • robotsCount - calculated field. Number of automation rules at the stage
  • possibleNextStages - array of stage IDs to move the item. Not used
  • permissions - set of permissions (for kanban).
    • droppable - items can be moved to this stage
    • canMoveFrom - items can be moved from this stage
rpa.stage.listForType({typeId: number, offset: ?number}) Method returns list of process stages, sorted in a sort order, with final stages at the end. Parameters:
  • typeId - process identifier. Required.
  • start - start for pagewise navigation

Each stage information contains only main stage data, without tasks, robotsCount, possibleNextStages, permissions


{
    "stages": [
        {
            "id": 1,
            "name": "Start",
            "code": "",
            "color": "22B9FF",
            "sort": 1000,
            "semantic": null,
            "typeId": 1,
            "isFirst": true,
            "isSuccess": false,
            "isFail": false,
        }
    ]
}
rpa.stage.add({fields: {}}) Method creates new stages and returns data similar to the response for query rpa.stage.get. Parameters:

fields - list with stage fields

  • fields[name] - stage name (required)
  • fields[typeId] - process ID (required)
  • fields[code] - symbolic code
  • fields[color] - stage color as HEX (6 characters)
  • fields[sort] - sorting identifier
  • fields[semantic] - stage semantics code. Can be either SUCCESS or FAIL

The process can have only one successful stage

rpa.stage.update({id: number, fields: {}}) Method updates stage with id and returns data similar to response for query rpa.stage.get. Parameters:
  • id - stage identifier
  • fields - list with stage fields. Fully the same to the set from method rpa.stage.add, but without typeId

Each process always must have one successful stage. You cannot change semantics of successful stage

rpa.stage.delete({id: number}) Method deletes a stage. Parameters:
  • id - stage ID

The process must always have one successful stage. Successful state cannot be deleted

© «Bitrix24», 2001-2024