閱讀及檢閱 Automation Anywhere 文件

Automation 360

關閉內容

內容

開啟內容

添加 Work Items 到隊列 API

  • 已更新:2021/09/15
    • Automation 360 v.x
    • 探索
    • RPA 工作區
    • API 文件

添加 Work Items 到隊列 API

添加或插入 Work Items 到現有隊列中 Control Room 根據定義的模型或結構。

先決條件

  • 用戶必須是隊列所有者和參與者
  • 您必須具有端點 URL:
    • <your_control_room_url>/v3/wlm/queues/{queueId}/workitems
    • <your_control_room_url>/v3/wlm/queues/list

程序

  1. 使用 POST 方法和端點 URL:<your_control_room_url>/v3/wlm/queues/{queueId}/workitems
    輸入 要添加 的 queueIdWork Item 在隊列中。
    註: 如果要搜索或獲取所有可用 queueId,請使用端點 URL <your_control_room_url>/v3/wlm/queues/list

    列出 WLM 隊列

    例如,使用 queueId 作為 17
    POST https://192.0.2.0/v3/wlm/queues/17/workitems

    Enter a workitem in the request body.

    註: 在請求正文中,確保沒有隱藏、無效、換行或 EOL 字符。您可以使用文本或源代碼編輯器檢查這些內容。
    請求正文:
    {
      "workItems": [
        {
          "json": {
            "first_name": "Jane",
            "last_name": "Doe",
            "email": "jane.doe@example.com"
          }
        }
      ]
    }
  2. 傳送要求。
    當請求成功時,一個唯一的 Work Itemid 在響應正文中返回,並且 Work Items 根據定義添加到隊列中 Work Item 模型或結構。
    在這個例子中, Work Itemfirst_nameJanelast_nameDoeemailjane.doe@example.com 添加到隊列中。
    回復正文:(截斷輸出)
    {
      "id": 77,
      "createdBy": 24,
      "createdOn": "2020-05-19T17:41:57.602092100Z",
      "updatedby": 24,
      "updatedOn": "2020-05-26T09:13:31.090241700Z",
      "version": 2,
      "json": {
        "first_name": "Jane",
        "last_name": "Doe",
        "email": "jane.doe@example.com"
      },
      "result": "",
      "deviceId": 0,
      "status": "NEW",
      "col1": "1.0",
      "col2": "",
        ... 
      "co21": "",
      "deviceUserId": 0,
      "queueId": 5,
      "comment": "",
      "automationId": 0,
      "totalPausedTime": 0,
      "error": ""
    }
  3. 選擇性的: If you want to add multiple Work Items, call the API using a list of Work Item JSON objects.
    Request body:
    {
      "workItems": [
        {
          "json": {
            "DATA": "mydata",
            "TRN_ID": "A11"
          }
        },
        {
          "json": {
            "DATA": "mydata",
            "TRN_ID": "A11"
          }
        }
      ]
    }
    Response body:
    {
        "list": [
            {
                "id": "40957",
                "createdBy": "25",
                "createdOn": "2021-11-24T01:53:10.175335900Z",
                "updatedBy": "25",
                "updatedOn": "2021-11-24T01:53:10.175335900Z",
                "version": "0",
                "json": {
                    "TRN_ID": "A11",
                    "DATA": "mydata"
                },
                "result": "",
                "deviceId": "0",
                "status": "NEW",
                "col1": "A11",
                "col2": "",
                "col3": "",
                "col4": "",
                "col5": "",
                "deviceUserId": "0",
                "queueId": "0",
                "comment": "",
                "automationId": "0",
                "totalPausedTime": "0",
                "error": "",
                "col6": "",
                "col7": "",
                "col8": "",
                "col9": "",
                "col10": "",
                "jobExecutionId": ""
            },
            {
                "id": "40958",
                "createdBy": "25",
                "createdOn": "2021-11-24T01:53:10.198337200Z",
                "updatedBy": "25",
                "updatedOn": "2021-11-24T01:53:10.198337200Z",
                "version": "0",
                "json": {
                    "TRN_ID": "A11",
                    "DATA": "mydata"
                },
                "result": "",
                "deviceId": "0",
                "status": "NEW",
                "col1": "A11",
                "col2": "",
                "col3": "",
                "col4": "",
                "col5": "",
                "deviceUserId": "0",
                "queueId": "0",
                "comment": "",
                "automationId": "0",
                "totalPausedTime": "0",
                "error": "",
                "col6": "",
                "col7": "",
                "col8": "",
                "col9": "",
                "col10": "",
                "jobExecutionId": ""
            }
        ]
    }
  4. 選擇性的: 如果你想更新 Work Item 數據,當自動化運行時,您需要執行以下步驟:
    1. 暫停自動化。使用 PUT 方法和以下端點 URL:<your_control_room_url>/v3/wlm/automations/{id}
    2. 更新 Work Item 通過使用隊列 ID 和 Work Item ID。使用 PUT 方法和以下端點 URL:<your_control_room_url>/v3/wlm/queues/{id}/workitems/{workitemId}
    3. 恢復自動化。使用 PUT 方法和以下端點 URL:<your_control_room_url>/v3/wlm/automations/{id}

後續步驟

創建自動化以運行帶有隊列的機器人

傳送意見反饋