Skip to content

Blue Prism Repository

datacorner edited this page Jul 13, 2023 · 3 revisions

The purpose of this page is to describe how to gather the Blue Prism logs by directly connecting to the Blue Prism Repository.

Characteristics

These are some characteristics of this bridge:

  • Gather logs from a selected Blue Prism process (use the processname parameter)
  • Can collect the Blue Prism variable values (only the desired ones)
  • Include or not the Objects/VBO logs (use the includevbo option). By including the VBOs activities it's possible to have a full view of the Process Execution.
  • Support BP Unicode or BP Non-Unicode Logs (use the unicode option)
  • Can gather Blue Prism logs data between 2 dates (use the command line todate and/or fromdate).
  • Support Delta or Full load (use the delta option).
  • Filter out/remove the selected stage types (For that, just use the stagetypefilters ini parameter an list all the stages types code not desired)
  • Can exclude all the Start and End stages except the First & Last one in the BP parent process (the ones in the Main Page). By this way it removes Starts and Ends potential duplicates (which exists on each pages & VBOs)

Execute (from Command line)

  • -sourcetype (Mandatory) bprepo
  • -configfile (Mandatory) Config file with all configuration details (INI format) / must follow the INI format rules. Example/Template -> See the config.ini-template (rename it as an .ini file)
  • -fromdate [Optional] From Date filtering (Delta load) (Format expected YYYY-MM-DD HH:MM:SS)
  • -todate [Optional] To Date filtering (Delta load) (Format expected YYYY-MM-DD HH:MM:SS)

Example

Launch the program in the shell (windows or linux) command line like this:

$ python3 bppibridge.py -sourcetype bprepo -configfile {config.ini} [-fromdate YYYY-MM-DD HH:MM:SS] [-todate YYYY-MM-DD HH:MM:SS]

High level architecture

The solution can be installed anywhere and just need:

  • To have access via ODBC to the Blue Prism Repository
  • To have access to the BPPI server (via its own REST APIs)
  • To have Python 3.10.* installed with the needed packages

Architecture

Configuration

The Bridge's configuration can be done in several steps.

Pre-Requisites

The Bridge must access to some Blue Prism Repository tables:

  • BPASession
  • BPAResource
  • BPASessionLog_NonUnicode or BPASessionLog_Unicode the SQL Server credentials are obviously mandatory, but it's also important to ensure to have the read access privilege to those tables.

Note: In Blue Prism it's possible to deactivate the trace (log) for each stage (Enabled, Disabled or on Error only), to be able to gather those logs after executing a Blue Prism Process it's mandatory to enable the logs for the stages you want to import into BPPI (Disabling the logs prevents Blue Prism to make some entries in the Blue Prism Reposotory).

BPPI

It's mandatory to create a Data Source in the BPPI Repository. At the end of this processus, BPPI provides a token needed for the configuration file.

See § [BPPI Configuration](BPPI Configuration.md)

The configuration file (ini)

Before using the bridge it's mandatory to create a configuration file. This configuration files is at the INI format (with sections and entries).

The Blue Prism Repository Access

This access is done via a SQL Server ODBC Connection string. Fill out the [database] section like this: Only two entries are necessary:

  • connections specifies the ODBC connection String. ODBC Connection String example: DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost\SQLEXPRESS;DATABASE=;UID=;PWD=***;ENCRYPT=No
  • query specifies the query template to use to query the Blue Prism Repository (see/copy here). Note: It's highly recommended to not change it except if you're really sure of what you're doing (at your own risk) ;-)
[database]
connectionstring=DRIVER={ODBC Driver 18 for SQL Server};SERVER={server Name}\{DB Instance};DATABASE={DB Name};UID={Username};PWD={Password};ENCRYPT=No
# filename which contains the SQL query 
query=bplogs.sql

Blue Prism

it's possible to configure the way the bridge will gather and manage the Blue Prism logs just by managing theses entries into the [blueprism] section:

  • processname Specifies the Process Name (only one Process can be investigated currently)
  • parameters Here you can put the name of the parameters to gather from the BP log files (into the xmlattributes field). These parameters are in fact the variables which are managed by Blue Prism while executing the Blue Prism Process. Just put a list of those variables separated by a comma.
  • stagetypefilters Your can list here (separated by a comma) all the stages types (by using their code) you want to filter out. Some example here :
    • 1 (always remove this one)
    • 2 -> Action
    • 4, 65536 -> Decision
    • 8 -> Calculation
    • 536870912 -> Multi Calculation
    • 128 -> Call page
    • 1024, 262144 -> Start
    • 2048 -> End
    • 131072 -> Writer
    • 262144 -> Navigate
    • 4194304 -> Wait
    • 16777216 -> Alert
    • 33554432 -> Exception
  • includevbo (yes/no) Include or not (yes/no) the VBO logs. If no only the Blue Process logs are collected.
  • unicode Indicates if we query the Unicode log table or not.
  • startendfilter (yes/no) Only keep the Start and End stages in the main Process page (remove all the other Start & End stages in the VBOs and other pages)
  • mainprocesspage if startendfilter=yes, this contains the name of the main Process page (by default Main Page)
  • delta (yes/no) delta load activated, if no -> full load
  • deltafile file where the latest timestamp load is saved (for the delta load only)

Configuration example:

[blueprism]
processname=IFA Application Process
parameters=Customer Number,Product,Investment,Deposit,Reason Text
stagetypefilters=1,4,65536,8,536870912
includevbo=yes
unicode=no
startendfilter=yes
mainprocesspage=Main Page
delta=yes
deltafile=delta.tag

BPPI Access

See the BPPI Configuration chapter

Log configuration

See the BPPI Configuration chapter

Event management (filtering or renaming)

See the BPPI Configuration chapter

The solutions also enables to make some changes in the stages names and also filter out some of them by using their name. To make that possible it's possible to provide a table (in a csv file) with only two columns. When using Blue Prism as a source by default the first column is a combination of several fields which provides the unique identifier of a stage name (see below). This identifier is used to match with the first column.

  • First columns contains the name of the real stage name. The format must respect this norm : {VBO|PROC}/{Process or Object Name}/{Process Page or VBO Action}/{Stage name}
    • {VBO|PROC} means the stage comes from a VBO or a Blue Prism Process
    • {Process or Object Name} Process or Object name
    • {Process Page or VBO Action}: Process Page (tab) or Object/VBO Action
    • {Stage name} Stage Name
  • Second columns contains:
    • The new name (that will appear in BPPI) if there's something filled out
    • if nothing, this stage name is simply removed

in the [events] section, you must specify then:

  • map (yes|no) if you want this mapping/filtering to happen or not
  • maptable filename with the above table
[events]
# Map the event names in the source dataset with a event map file (CSV file with two columns)
map=no
maptable=./test/evtmap.csv

Clone this wiki locally