Created
February 17, 2020 07:01
-
-
Save evancohen/8afb86cf7cedcb21df48df046710907a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
try{ | |
// Get the list of processes | |
const processes = await UiPathRobot.getProcesses() | |
// Find a specific process by ID | |
const sample = processes.find(p => p.id == "c9973f8d-a46b-41cd-8436-f411cdba3355") | |
// Start the process (creates a job) | |
const job = sample.start({ NumberToAdd: 0 }) | |
// When the job status changes, log it to the console | |
job.onStatus(status => {console.log(`Status: ${status}`)}) | |
// After the job completes log process results to the console | |
const results = await job | |
console.log(results) | |
} catch(e) { | |
// Handle any errors | |
console.error(e) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment