Implementing a robot task by using a robotic process automation tool

A robot task in a process is an automated user task. Learn about the approaches you can use to implement the task in a robotic process automation (RPA) tool. If you use IBM® Robotic Process Automation (IBM RPA) with Automation Anywhere, see the topic Implementing a robot task in the IBM RPA documentation for more information.

About this task

Depending on the capabilities of your RPA tool and the skills of your bot developers, you can build a bot that uses REST APIs or one that uses IBM Process Portal and the coach user interface for the robot task.

Procedure

  • Use the REST APIs.
    If your RPA tool supports REST API invocations well, use the following IBM Business Automation Workflow REST APIs for the task interactions.
    • Retrieve and claim the task by using the following API patterns:
      • Get Next pattern
        • Use the Get Next Task API to retrieve the next task and directly claim it, for example:
          PUT /rest/bpm/wle/v1/task?action=getNext&query=IBM.DEFAULTALLTASKSLIST_75&queryFilter=STATE=STATE_READY AND NAME IN('Robot Task Name1', 'Robot Task Name2')&sortAttributes=PRIORITY,DUE
        • Use the Get Task Details API to retrieve the task information:
          GET /user-tasks/{task-id}?optional_parts=data
          For more information, see IBM Business Automation Workflow REST APIs resources.
      • Task List pattern
        • Use the Search Execution API to retrieve a list of tasks that are ready to be claimed, for example:
          PUT /rest/bpm/wle/v1/tasks?savedSearch=IBM.DEFAULTALLTASKSLIST_75&fields=TKIID&interaction=available&sort=PRIORITY,DUE&size=100&filterByCurrentUser=true&calcStats=false
        • Use the Claim Task API to claim one of the tasks from the list:
          POST /user-tasks/{task-id}/claim?optional_parts=data
          For more information, see IBM Business Automation Workflow REST APIs resources.
    • If the bot performed the work on the task successfully, complete the task by using the following API call:
      POST /user-tasks/{task-id}/complete
      For more information, see IBM Business Automation Workflow REST APIs resources.
    • If the bot cannot perform the work on the task, fail the task by using the following API call:
      POST /user-tasks/{task-id}/fail
      The robot task accepts the BPMBotFailedError error code and expects a string as the error data. For more information, see IBM Business Automation Workflow REST APIs resources.
  • Use Process Portal and the coach user interface for the robot task.
    1. Create a bot in your RPA tool that logs into Process Portal by using the functional ID that you used for the team assignment of the robot task in Process Designer. Your bot can use the Work dashboard and pick a task to work on, or use the Get Next dashboard to see the next available task to work on. For more information about Process Portal dashboards, see Dashboards in Process Portal.
    2. When a bot claims a task, it must retrieve the input data from the coach by extracting the various fields in the Input section. It can then use the task data to perform the work that is needed. When the work is finished, the bot completes the task by entering the output data in the Output section and clicking the Done button.
    3. If the bot cannot perform the work on the task, it fails the task by filling the Error Description and clicking the Fail button. This action causes a BPMBotFailedError error that can be handled in the process.