Teneo Developers

UiPath

The UiPath example solution showcases how you can use your Teneo bot for Robotic Process Automation (RPA) with UiPath. The solution contains an integration with UiPath and example flows to start a job and retrieve the status of jobs in UiPath.

UiPath

Solution contents

UiPath integration

The solution contains a UiPath backend integration with the following methods:

  • Get Access Token
  • Start Job
  • Get Jobs

The methods make use of a class called UiPathHelper. You can find the UiPathHelper.groovy file with the source code in the resource file manager of the solution. This allows you to easily modify or extend the class if needed.

Note: you can edit the class straight from Teneo by selecting the UiPathHelper.groovy file and clicking 'Open'. See: Opening and editing files in an external editor for more details.

Example flows

For each core method in the UiPath integration, the solution contains a corresponding example flow:

  • Start UiPath Job
  • Get UiPath Jobs

Authentication subflow

The solution contains a subflow called 'Subflow: Get UiPath Access Token' to authenticate with the UiPath Cloud API. The flow checks if an access token is available for the session, and if not, retrieves one. This subflow should be used in each flow that interacts with UiPath.

Getting started

Prerequisites

  • These instructions assume you have a UiPath account with a published UiPath process.
  • To follow these instruction you need to have the Organization Owner or Organization Administrator role in UiPath.
  • These instructions assume you have downloaded and imported the UiPath solution. See the instructions below.

Getting the UiPath API Access information

To be able to ineract with the UiPath Orchestrator API some keys and tokens need to be stored in the solution. Follow the instructions in the Consuming Cloud API section in the UiPath Orchestrator API Guide to find the following keys:

  • User Key
  • Account Logical Name
  • Tenant Logical Name
  • Client Id

Store them in the corresponding global variables in your UiPath solution in Teneo:

  • uipathUserKey
  • uipathAccountLogicalName
  • uipathTenantLogicalName
  • uipathClientId

Make sure you hit 'Save' in the top right corner each time you update a global variable field.

Specify which process to start

The example flow 'Start UiPath Job' is used to start a job for a process in UiPath. To specify which process should be started when this flow is triggered, proceed as follows:

  1. Open the flow 'Start UiPath Job' in edit mode.
  2. Add the name of the process to the flow variable processName.
    • You can find a list of processes in the Processes section of your UiPath Orchestrator Service.
  3. Depending on the process you may need to provide input arguments. Those can be added as a map to the variable inputArguments.

The Start UiPath Job flow is a basic example flow that can be used as a starting point. Most use cases require extending this flow to collect the details required to start a job.

Try it Out

After you have added the details above, you can try it out as follows:

User: Start job
Bot: Started job with ID: 829939.

User: Get jobs
Bot: Details for jobs started this session: [{id=829939, releaseName=MyProcessName_Test Environment, state=Successful, info=Job completed, inputArguments=null}]

How does it work?

  • The 'Start UiPath Job' flow calls the subflow 'Subflow: Get UiPath Access Token' to check if the global variabe uipathAccessToken contains a value. If not, it will call the method Get Access Token in the UiPath integration. The access token received is then stored in the global variable uipathAccessToken.
  • The 'Start UiPath Job' flow then calls the method Start Job in the UiPath integration to start a job with the process name specified in the processName flow variable. The flow adds the job ID returned by UiPath to a list in the global variable called uipathJobs.
  • The 'Get UiPath Jobs' flow also calls the subflow 'Subflow: Get UiPath Access Token' to check if the global variabe uipathAccessToken contains a value. In this case there is, so the subflow basically does nothing.
  • The 'Get UiPath Jobs' flow then calls the method Get Jobs in the UiPath integration. This retrieves the job details for each jobId that is stored in the global variable uipathJobs. The details received are then returned in the answer text.

Download