Orchestrator
2022.4
falso
Imagem de fundo do banner
Guia da API do Orchestrator
Última atualização 10 de nov de 2023

Solicitações de itens de fila

Importante:
/QueueItems Os pontos de extremidade contam e retornam o DTO para cada recorrência de um item da fila em todas as pastas às quais a fila está vinculada. Por exemplo, se você tiver um (1) item da fila para uma fila que esteja vinculado a três (3) pastas, o número de itens de fila retornados e a contagem serão três (1x3).
Para recuperar os resultados para uma pasta específica, use o cabeçalho X-UiPath-OrganizationUnitId.

Excluir o valor SpecificContent de um item de fila

A solicitação PUT a seguir para o endpoint /odata/QueueItems({key}) permite que você exclua o conteúdo específico do item de fila especificado, identificável por {key}.
Importante: agora você também pode excluir o conteúdo específico dos itens da fila com os status Bem-sucedido,Excluídoou Repetido .

Ponto de Extremidade da API

COLOCAR /odata/QueueItems({Id})

Para excluir o conteúdo específico, você precisa definir o valor correspondente como NULL ou vazio, enquanto todos os outros valores na carga correspondem aos do estado bem-sucedido. Ou seja, você exclui apenas o conteúdo, enquanto todos os outros parâmetros da solicitação permanecem os mesmos.

Para descobrir quais são os valores dos parâmetros da solicitação PUT, faça uma solicitação GET para/odata/QueueItems. A resposta exibe todos os itens da fila em seu locatário.

Identifique o item da fila de seu interesse e copie os valores dos seguintes parâmetros:

  • "OrganizationUnitId" o ID da pasta que contém o item da fila
  • "Id" o ID do item da fila. Certifique-se de selecionar o item da fila com o status Bem-sucedido .

Faça uma segunda solicitação GET para /odata/QueueItems({Id})e substitua o {Id} pelo ID do item da fila que você copiou da chamada GET anterior. A resposta exibe os dados do item de fila desejado. Copie os valores dos seguintes parâmetros:
  • "Nome" para substituir {the_Name_from_the_GET_response} na solicitação de amostra
  • "Prioridade" para substituir {the_Priority_from_the_GET_response} no exemplo de solicitação
  • "DataDeAdiamento" para substituir {the_DeferDate_from_the_GET_response} no exemplo de solicitação.
  • "DataDeConclusão" para substituir {the_DueDate_from_the_GET_response} no exemplo de solicitação.
  • "RiskSlaDate" para substituir {the_RiskSlaDate_from_the_GET_response} na solicitação de amostra
  • "Referência" para substituir {the_Reference_from_the_GET_response} no exemplo de solicitação.
  • "Progresso" para substituir {the_Progress_from_the_GET_response} no exemplo de solicitação.
    Observação: use os valores de parâmetro acima para preencher o corpo da solicitação PUT.

Cabeçalhos de solicitação.

--header 'Authorization: Bearer {access_token}'\
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_queue_item}' \--header 'Authorization: Bearer {access_token}'\
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_queue_item}' \

Parâmetros do caminho

Parâm

Tipo de dados

Description

Id

(obrigatório)

String

A ID do item de fila do qual você deseja excluir o conteúdo específico.

Corpo da Solicitação

O corpo da solicitação contém as informações do item da fila que você deseja atualizar, como nome, prioridade ou referência.

Nota: Para este caso de uso, você precisa atualizar APENAS o valor da chave 'SpecificContent'.
{
      "Name": "{queue_name}", // String, the_name_of_the_container_queue
      "Priority": "{the_Priority_from_the_GET_response}",//String
    "SpecificContent": {}, // or NULL
      "DeferDate": "{the_DeferDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "DueDate": "{the_DueDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "RiskSlaDate": "{the_RiskSlaDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "Reference": "{the_Reference_from_the_GET_response}", // String
      "Progress": "{the_Progress_from_the_GET_response}" // String
}{
      "Name": "{queue_name}", // String, the_name_of_the_container_queue
      "Priority": "{the_Priority_from_the_GET_response}",//String
    "SpecificContent": {}, // or NULL
      "DeferDate": "{the_DeferDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "DueDate": "{the_DueDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "RiskSlaDate": "{the_RiskSlaDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "Reference": "{the_Reference_from_the_GET_response}", // String
      "Progress": "{the_Progress_from_the_GET_response}" // String
}

Exemplo de solicitação

Digamos que você reuniu todas as informações necessárias para criar a chamada de API.

Obtenha os valores OrganizationUnitId e Id do item da fila

Para descobrir os IDs dos itens da pasta e da fila, faça uma solicitação GET para o terminal /odata/QueueItems :
curl --location --request GET '{OrchestratorURL}/odata/QueueItems' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \curl --location --request GET '{OrchestratorURL}/odata/QueueItems' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \

Uma amostra da resposta que você pode receber:

{
  "value": [
    {
      "QueueDefinitionId": 29200,
      "OutputData": "{\"DynamicProperties\":{\"Prop1\":\"run\"}}",
      "AnalyticsData": null,
      "Status": "New",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "bc4e8fac-dc4b-4f77-8f20-13590e19ff26",
      "Reference": null,
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": null,
      "Priority": "Normal",
      "DeferDate": null,
      "StartProcessing": "2022-02-16T15:30:12.13Z",
      "EndProcessing": "2022-02-16T15:30:12.46Z",
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"Prop2\":\"accelerate\"}}",
      "CreationTime": "2022-02-16T15:30:11.753Z",
      "Progress": null,
      "RowVersion": "AAAAAAB2liA=",
      "OrganizationUnitId": 62516,
      "OrganizationUnitFullyQualifiedName": "Banana",
      "Id": 3255808,
      "ProcessingException": null,
      "SpecificContent": {
        "Prop2": "Test demo"
      },
      "Output": {
        "Prop1": "vgdfdf"
      },
      "Analytics": null
    },
// other queue items data
    {
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": "Shared",
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }
  ]
}{
  "value": [
    {
      "QueueDefinitionId": 29200,
      "OutputData": "{\"DynamicProperties\":{\"Prop1\":\"run\"}}",
      "AnalyticsData": null,
      "Status": "New",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "bc4e8fac-dc4b-4f77-8f20-13590e19ff26",
      "Reference": null,
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": null,
      "Priority": "Normal",
      "DeferDate": null,
      "StartProcessing": "2022-02-16T15:30:12.13Z",
      "EndProcessing": "2022-02-16T15:30:12.46Z",
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"Prop2\":\"accelerate\"}}",
      "CreationTime": "2022-02-16T15:30:11.753Z",
      "Progress": null,
      "RowVersion": "AAAAAAB2liA=",
      "OrganizationUnitId": 62516,
      "OrganizationUnitFullyQualifiedName": "Banana",
      "Id": 3255808,
      "ProcessingException": null,
      "SpecificContent": {
        "Prop2": "Test demo"
      },
      "Output": {
        "Prop1": "vgdfdf"
      },
      "Analytics": null
    },
// other queue items data
    {
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": "Shared",
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }
  ]
}

Identifique o item da fila Bem-sucedido e copie os seguintes valores:

  • "OrganizationUnitId" : 39419
  • "Id": 2499339

Obtenha os dados do item de fila desejado

Faça uma solicitação GET para o terminal /odata/QueueItems({Id}) :
  • Substitua {Id} pelo valor do ID encontrado anteriormente (ou seja, 2499339)
  • Use o cabeçalho de solicitação X-UIPATH-OrganizationUnitId e insira o valor do OrganizationUnitId encontrado anteriormente (ou seja, 39419)
    curl --location --request GET '{OrchestratorURL}/odata/QueueItems(2499339)' \
    --header 'Authorization: Bearer 1234' \
    --header 'Content-Type: application/json' \
    --header 'X-UIPATH-OrganizationUnitId: 39419'curl --location --request GET '{OrchestratorURL}/odata/QueueItems(2499339)' \
    --header 'Authorization: Bearer 1234' \
    --header 'Content-Type: application/json' \
    --header 'X-UIPATH-OrganizationUnitId: 39419'

    Uma amostra da resposta que você pode receber:

    {
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": null,
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }{
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": null,
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }

Copie os seguintes valores:

  • "Priority" : "High"
  • "DeferDate" : null
  • "DataDeConclusão" : nulo
  • "RiskSlaDate": "2022-02-17T13:27:43.895Z"
  • "Reference" : "82086"
  • "Progress" : null

Exclua o valor SpecificContent

Faça a solicitação PUT da seguinte forma:

curl --location --request PUT '{OrchestratorURL}/odata/QueueItems(2499339)' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: 39419'\
--data-raw '{
      "Name": "    Queue Demo", 
      "Priority": "High", 
    "SpecificContent": {},
      "DeferDate": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Reference": "82086",
      "Progress": null
}'curl --location --request PUT '{OrchestratorURL}/odata/QueueItems(2499339)' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: 39419'\
--data-raw '{
      "Name": "    Queue Demo", 
      "Priority": "High", 
    "SpecificContent": {},
      "DeferDate": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Reference": "82086",
      "Progress": null
}'
Nota: Observe que o parâmetro SpecificContent é o único que muda, por ter um valor NULL ou vazio, enquanto o restante dos valores correspondem aos valores da resposta GET.

Na interface do usuário do orquestrador, a alteração fica visível nos detalhes da transação do ID da transação correspondente.



Was this page helpful?

Obtenha a ajuda que você precisa
Aprendendo RPA - Cursos de automação
Fórum da comunidade da Uipath
Logotipo branco da Uipath
Confiança e segurança
© 2005-2024 UiPath. All rights reserved.