How to get Session ID using command line options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-12-22 03:40 PM
I tries to call the /getlog <sessionid> to get the log of the session using Command line options (AutomateC.exe), This function requires session id as a parameter, Can you explain me how can I get the session id of the existing session ?
------------------------------
Victor C
Associate
Cognizant
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-12-22 04:21 PM
------------------------------
Dave Morris
3Ci at Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-12-22 05:11 PM
If you know the specific runtime resource that's running the process you can use the HTTP interface and resource PC commands of the resource PC to get the active session ID. If you're on BP v7 or later, and you've deployed the REST API, you can use it to get session information.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-01-23 07:03 AM
Step 1: Run this command line using the "Utility - Environment::Start Process Read Stderr and Stdout" . Here is an example command from my DEV setup:
"/run ""Simple Child Process 1"" /resource MACHINE_NAME /user BP_User_Name BP_Password /startp ""<inputs> <input name='Text Parameter' type='text' value='" & [Text Param 1] & "' /><input name='Numeric Parameter' type='number' value='" & [Num Param 2] & "' /></inputs>"""
Started process:Simple Child Process 1
Resource: MACHINE_NAME
Actual resource: MACHINE_NAME
Session:1c778a54-1af6-4eab-a772-20687af0ab11
Step 2: Extract the Session ID using the RegEx utility (or string parsing) into a local variable. It would be safe to add a Trim(SESSION_ID) to remove the trailing line break. Otherwise you will be spending hours trying to figure out why subsequent command lines don't work!
The next step is to confirm that you process has completed before calling /getlog
Step 3: In this case, I set up a Decision Loop with a timeout to wait for the Session status to go from "Running" to "Completed"
Again, I use the "Utility - Environment::Start Process Read Stderr and Stdout" to run this following command line and fetch the session status:
"/status " & Trim([SESSION_ID]) & " /user BP_User_Name BP_Password"
As before, extract the sessions status using RegEx. Break the loop when the status changes from "Running" to "Completed" (or when it times out in which case it's a failure scenario).
Step 4: Finally, use the /getlog switch to get the log from the session ID like so:
"/getlog " & Trim([Session ID]) & " /user BP_User_Name BP_Password "
Something to note:
It may be an issue with my BP installation. The /getlog in my case is unable to return the output parameters returned by the target process. Instead it just outputs simple log lines. I have raised a ticket with BP to address this issue.
-Andy
------------------------------
Prashanth (Andy) Menon
------------------------------
