Robotic Process Automation and Low-Code: A Quick Introduction, with a Practical Tutorial on Integrating UiPath with Joget
Blog: Joget Unplugged
Robotic Process Automation (RPA) is one of the hottest enterprise technologies today. What is it all about? This article will provide a simple introduction to RPA, and explain how it complements low-code application platforms.
- Part 1: Get Started with UiPath
- Part 2: Get Started with Joget
- Part 3: Integrate UiPath with Joget
Introduction to RPA
What is Robotic Process Automation (RPA)?
How is RPA Different from Macros or Scripting?
- RPA platforms can manage, monitor and audit robots on an enterprise-wide scale, as opposed to old desktop based approaches that only work on single machines.
- RPA robots can execute autonomously and interact with multiple applications at a time, instead of being bound within a specific application.
- RPA robots can incorporate AI and machine learning to adapt and even handle exceptions.
Why Use RPA and How it Complements Low-Code Application Platforms
- Allows existing processes to be completed more rapidly and efficiently
- Creates cost savings for manual and repetitive tasks
- Reduces errors and ensures more predictable processing times to comply with regulations and standards
Tutorial Part 1: Get Started with UiPath
UiPath Overview
UiPath Component Architecture |
- UiPath Studio: UI tool to visually design the process to automate
- UiPath Orchestrator: Web application that manages the creation, monitoring, and deployment of all robots and processes
- UiPath Robot: Runs processes that were built in UiPath Studio. Execution agent that is installed and executed in the actual machine.
- Visually design a process using UiPath Studio in a developer PC,
- Publish/deploy the process to UiPath Orchestrator to be managed, scheduled and monitored.
- The actual process itself is executed by the UiPath Robots installed in the respective machines.
UiPath Concepts and Terms
- Machine: Represents the actual machine the robot executes in
- Environment: An environment is a grouping of Robots, that is used to deploy processes
- Package: A UiPath Studio project that is published
- Process: A process represents the association between a package and an environment. Each time a package is deployed to an environment, it is automatically distributed to all machines that belong to that environment.
- Job: A job is the execution of a process on one or multiple Robots.
- Library: A process library describes a system of activities that are reusable for sharing
- Schedule: Enables jobs to be executed in a preplanned manner
- Asset: Usually represent shared variables or credentials that can be used in different projects.
- Queue: A place to store multiple types of data, such as invoice information or customer details.
Step 1: Sign Up for UiPath Cloud Platform
Step 2: Install UiPath Studio and UiPath Robot
Step 3: Launch UiPath Robot and Obtain Machine Name
Step 4: Obtain Machine Key
Step 5: Connect UiPath Robot to the Machine
Step 6: Create a Robot
Step 7: Add Robot to Environment
Step 8: Start a Job
Step 9: Prepare for UiPath Integration
1. Get Access and ID Tokens
1.1 Generate Code Challenge and Code Verifier
function base64URLEncode(str) {
return str.toString('base64')
.replace(/+/g, '-')
.replace(///g, '_')
.replace(/=/g, '');
}
function sha256(buffer) {
return crypto.createHash('sha256').update(buffer).digest();
}
console.log("Generating challenge and Verifier");
var cryptoResult = crypto.randomBytes(32);
var verifier = base64URLEncode(cryptoResult);
var challenge = base64URLEncode(sha256(verifier));
console.log("Code challenge: " + challenge)
console.log("Code verifier: " + verifier);
Generating challenge and Verifier
Code challenge: RzYlHiiGzPGgOLaRQJYftZ1mmc3sCbeicZVRftTmC-A
Code verifier: YVMnLczXQgJ9dwzV7MlMWEjGyAia4nXvTZzU4UVrAPE
1.2 Get Authorization Code
https://account.uipath.com/authorize?response_type=code&nonce=b0f368cbc59c6b99ccc8e9b66a30b4a6&state=47441df4d0f0a89da08d43b6dfdc4be2&code_challenge=[code_challenge]&code_challenge_method=S256&scope=openid+profile+offline_access+email &audience=https%3A%2F%2Forchestrator.cloud.uipath.com&client_id=5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN&redirect_uri=https%3A%2F%2Faccount.uipath.com%2Fmobile
https://account.uipath.com/mobile?code=[authorization_code]&state=47441df4d0f0a89da08d43b6dfdc4be2
1.3 Get Refresh Token
{
"grant_type": "authorization_code",
"code": "[authorization_code]",
"redirect_uri": "https://account.uipath.com/mobile",
"code_verifier": "[code_verifier]",
"client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN"
}
{
"access_token": "eyJ0eX...",
"refresh_token": "CBZcOD6vrP2FQ9qa8fuqDdfoEwnVPuR2Kp...",
"id_token": "eyJ0eX...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
1.4 Get Access Token and ID using the Refresh Token
{
"grant_type": "refresh_token",
"client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN",
"refresh_token": "CBZcOD6vrP2FQ9qa8fuqDdfoEwnVPuR2Kpz-hitbTAIzG"
}
{
"access_token": "eyJ0eX...",
"id_token": "eyJ0eX...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
2. Get UiPath Account, Service and Process Identifiers
2.1 Get the Account Logical Name
Authorization: Bearer [id_token]
Copy the value for accountLogicalName from the response:
{
"userEmail": "demo@domain.com",
"accounts": [
{
"accountName": "Demo",
"accountLogicalName": "Demo"
}
]
}
2.2 Get Service Instance Logical Name
Authorization: Bearer [id_token]
[
{
"serviceInstanceName": "DemoDefault",
"serviceInstanceLogicalName": "DemoDefaultzous50676",
"serviceType": "ORCHESTRATOR",
"serviceUrl": "https://platform-community.azurewebsites.net"
}
]
2.3 Get Release Key for the Desired Process
Authorization: Bearer [access_token]
X-UIPATH-TenantName: [serviceInstanceLogicalName]
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Releases",
"@odata.count": 1,
"value": [
{
"Key": "b27c7363-459c-4520-bae5-660d4a1d3813",
"ProcessKey": "Demo_Process",
"ProcessVersion": "1.0.21",
"IsLatestVersion": false,
"IsProcessDeleted": false,
"Description": "Demo Process",
"Name": "Demo Process",
"EnvironmentId": 98069,
"EnvironmentName": "Demo Environment",
"InputArguments": null,
"QueueDefinitionId": null,
"QueueDefinitionName": null,
"Id": 120897,
"Arguments": {
"Input": null,
"Output": null
},
"ProcessSettings": null
}
]
}
2.4 Test Orchestrator API Call to Start a Job
- refresh_token (Refresh Token)
- access_token (Access Token)
- serviceInstanceLogicalName (Service Instance Logical Name)
- Key (Release Key)
Authorization: Bearer [access_token]
X-UIPATH-TenantName: [serviceInstanceLogicalName]
{
"startInfo":
{ "ReleaseKey": "b27c7363-459c-4520-bae5-660d4a1d3813",
"Strategy": "All",
"RobotIds": [ ],
"JobsCount": 0,
"Source": "Manual"
}
}
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Jobs",
"value": [
{
"Key": "e811bd29-26fb-4cc3-af91-7fd6308ca643",
"StartTime": null,
"EndTime": null,
"State": "Pending",
"Source": "Manual",
"SourceType": "Manual",
"BatchExecutionKey": "382e7a96-a5b9-4343-b258-26a80cf87f80",
"Info": null,
"CreationTime": "2019-06-12T08:02:03.2595408Z",
"StartingScheduleId": null,
"ReleaseName": "Demo Process",
"Type": "Unattended",
"InputArguments": null,
"OutputArguments": null,
"HostMachineName": null,
"HasMediaRecorded": false,
"Id": 10169582
}
]
}
Tutorial Part 2: Get Started with Joget
Joget Overview
Joget Platform Architecture |
Sign Up for Joget Workflow On-Demand
Tutorial Part 3: Integrate UiPath with Joget
How to Integrate with UiPath
Design a Joget Process to Start a UiPath Job
- refresh_token (Refresh Token)
- serviceInstanceLogicalName (Service Instance Logical Name)
- Key (Release Key)
Step 1. Design New App
Step 2. Design New Process
- status
- id_token
- access_token
Step 3. Configure First Tool to Get UiPath Access Token
JSON URL
|
|
Call Type
|
POST
|
POST Method
|
Custom JSON Payload
|
Custom JSON Payload
|
{
“grant_type”: “refresh_token”,
“client_id”: “5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN”,
“refresh_token”: “[refresh_token]“
}
|
access_token
|
access_token
|
id_token
|
id_token
|
Step 4. Configure Second Tool to Start Job Using the Access Token
JSON URL
|
|
Call Type
|
POST
|
POST Method
|
Custom JSON Payload
|
Custom JSON Payload
|
{ “startInfo”:
{ “ReleaseKey”: “[Key]“,
“Strategy”: “All”,
“RobotIds”: [ ],
“JobsCount”: 0,
“Source”: “Manual”
}
}
|
Request Headers
|
Authorization: Bearer #variable.access_token#
X-UIPATH-TenantName: [serviceInstanceLogicalName]
|
status
|
value[0].State
|
Step 5. Run the Process
Conclusion
We then covered a tutorial on getting started with UiPath and Joget, followed by a tutorial on integration between them. As demonstrated in the tutorial, a lot of the work required for integration is in preparing the authentication mechanism to the UiPath Orchestrator API. Once the required integration keys are available, the configuration in Joget to invoke the UiPath API itself is pretty simple.
To learn more about each of the platforms, visit UiPath and Joget.
Leave a Comment
You must be logged in to post a comment.