Using the process app for BAW (IBM Business Automation Workflow)
The BAW process app (a process app for Business Automation Workflow) is not available by default on the Process App page. You can download the extractor and the BAW process app to extract, transform, and load the process data to IBM Process Mining.
With the BAW process app, you can extract data from BAW by using the BAW connector, and then transform and load the data into IBM Process Mining.
The process app is intended as a PoC (proof of concept) asset. It is an example on how to use business insights derived from BAW workflows using IBM Process Mining.
You can import the BAW process app from the BAW-IBM-Process-Mining-Assets.zip
file, which you can download from here.
To use the BAW process app, complete the following steps:
- Set up the BAW connector.
- Run the BAW Connector Module.
- Upload the custom process app to IBM Process Mining.
- Create a process by using the BAW process management app.
Setting up the BAW connector
The BAW connector is a Python module that is designed to extract raw data from Business Automation Workflow (BAW) and create CSV files. The connector offers interactive file-based options to configure the extraction of data.
This connector uses asynchronous programming to process multiple tasks concurrently and includes a scheduling feature for up to 24 hours. The data flow involves steps like gathering configuration details, setting logging, choosing execution modes, retrieving instance lists, extracting data in parallel, and generating CSV files.
To set up and use the BAW connector, complete the following steps:
-
Go to the BAW-Connector Directory.
If you download the
BAW-IBM-Process-Mining-Assets.zip
file, extract the file and go to theBAW-Connector
directory.If you download the
BAW-Connector.zip
file from the imported BAW Process App within Process Mining, extract thezip
in BAW-Connector folder and access the BAW-Connector directory.cd <path to your folder>/BAW-Connector
-
Create a BAW Connector Virtual Environment.
Use the Python virtual environment tool to create a dedicated environment for the BAW Connector.
python -m venv bawc_venv
-
Activate the Virtual Environment
Activate the BAW Connector virtual environment to isolate dependencies and ensure compatibility.
-
macOS/Linux
source bawc_venv/bin/activate
-
Windows in CMD
.\bawc_venv\Scripts\activate.bat
-
Windows in Powershell
.\bawc_venv\Scripts\Activate.ps1
-
-
Install required dependencies.
Use pip
to install all required dependencies/libraries listed in the requirements.txt
file within the virtual environment.
pip install -r requirements.txt
Running the BAW Connector Module
To run the BAW connector module, you can use the following functions as entry points to the BAW_Connector.py
module:
- main function (User interaction by command line)
- system_extract_baw_data function(interactive or system integration/automation
Main function (User interaction by command line)
This function runs the BAW Connector directly from the command line. It displays a brief instruction on how to run the BAW_Connector.py
module interactively and prompts how you can run the module for extracting BAW data.
To run the BAW_Connector.py
module on the command line:
-
Go to the
BAW-Connector
folder.cd <path to your folder>/BAW-Connector
-
Run the BAW Connector tool. You can run the BAW Connector in the following ways of passing the configuration:
a. Executing the connector module with the correct command line but nothing is passed as command arguments:
python BAW_Connector.py
Or
python -m BAW_Connector
If you do not provide any command arguments or JSON file or if there is an error in the provided configuration variables (either in the command-line arguments or in the JSON file), an interactive mode is displayed with further instructions:
-
'i' is provided to add all variables individually when prompted (no quotes on strings).
-
'c' is provided to add all variables in 1 line, with each key=value pair that contains no quotes and each new key separated from the last value by the space character.
After you select 'c', you are prompted to enter variables (no quote on the values of the variables).
For example,
root_url= process_name= project= from_date= from_date_criteria=<one of these: modifiedAfter/createdAfter/closedAfter> to_date= to_date_criteria=<one of these: modifiedBefore/createdBefore/closedBefore> status_filter=<either one or all of these: Active,Completed,Failed,Terminated,Suspended,Late,At_Risk> instance_limit= offset= thread_count= csvpath= csvfilename= logfile= user_name= password= schedule_time=<HH:mm (e.g. 13:33) or cron expression (e.g. 33 13 * * * or */1 * * * *)>
-
'p' is provided to add all variables through a JSON file.
-
's' is provided to read all variables through environment variables.
b. Executing the connector module with the correct command line and command arguments as source of configuration variables.
For example,
python BAW_Connector.py root_url= process_name= project= from_date= from_date_criteria=<one of these: modifiedAfter/createdAfter/closedAfter> to_date= to_date_criteria=<one of these: modifiedBefore/createdBefore/closedBefore> status_filter=<either one or all of these: Active,Completed,Failed,Terminated,Suspended,Late,At_Risk> instance_limit= offset= thread_count= csvpath= csvfilename= logfile= user_name= password= schedule_time=<HH:mm (e.g. 13:33) or cron expression (e.g. 33 13 * * * or */1 * * * *)>
-
The only difference between this instruction and selecting the instruction 'c' is that it additionally includes the values for root_url, process_name, csvpath, and schedule_time.
c. Executing the connector module with the correct command line and on a JSON configuration file as the source of configuration variables:
python BAW_Connector.py ./baw_config.json
The JSON template:
{
"root_url": "",
"process_name": "",
"project": "",
"from_date": "2011-08-04T03:12:53Z",
"from_date_criteria": "",
"to_date": "2024-08-04T03:12:53Z",
"to_date_criteria": "",
"status_filter": "Active,Completed,Failed,Terminated,Suspended,Late,At_Risk",
"instance_limit": 10,
"offset": 0,
"thread_count": 1,
"csvpath": "",
"csvfilename": "",
"logfile": "",
"user_name": "",
"password": ""
}
Table 1. Description of JSON parameters
JSON Parameter | System/environment Variable | Description |
---|---|---|
root_url | BAW_ROOT_URL | Defines creating an API request for IBM Business Automation Workflow. Must be the hostname for calling the BAW APIs. |
process_name | BAW_PROCESS_NAME | Returns the instances for the full name of the BAW process/BPD instance that you are searching for. |
Project | BAW_PROJECT_NAME | Returns the instances for the specified projects, which are identified by their acronyms (short names). The preceding process_name belongs to this project. |
from_date | BAW_START_DATE | Includes only BPD instances from this date onwards. The date must be in ISO8601 format, such as 2011-08-04T03:12:53Z. |
from_date_criteria | BAW_START_DATE_CRITERIA | From_date can be based on creation, modification, or closure. You must use one of these values: createdAfter, modifiedAfter, closedAfter |
to_date | BAW_END_DATE | Includes only BPD instances up to the specified date. The date must be in ISO8601 format, such as 2011-08-04T03:12:53Z. |
to_date_criteria | BAW_END_DATE_CRITERIA | To_date can be based on creation, modification, or closure. You must use one of these values: createdBefore, modifiedBefore, closedBefore |
Status_filter | BAW_STATUS_FILTER | Returns the instances that have only the specified status. The list of status values is: Active, completed, Failed, Terminated, Suspended, Late, At_Risk. To specify more than one status value, separate the values with a comma, like this: Active,Late,Failed,At_Risk. |
Instance_limit | BAW_INSTANCE_LIMIT | The maximum number of instance summaries to return. |
Offset | BAW_OFFSET | The number of instances to skip before collecting data. If for example, you generated a CSV file with 10 instances where offset=0, you might query with instance limit 10 and offset=10 to collect the next 10 results after these. |
thread_count | BAW_THREAD_COUNT | Choose the number of threads to run the BAW Connector over. You can increase the number of threads for larger instance_limits to concurrently collect data but this increases the load on the BAW server too. A good balance needs to be found |
Csvpath | BAW_CSV_PATH | Provide a path for the file that the BAW Connector generates. |
Csvfilename | BAW_CSV_FILENAME | Provide the name of the specific csv file that BAW Connector generates (without the file extension). |
Log file | BAW_LOG_FILE | Provide the name of the specific log file that tracks the BAW Connector execution details (without the file extension). Consists of data file that contains information about usage patterns, activities, and operations. |
username | BAW_USERNAME | IBM BAW user to allow the IBM BAW API to be called. |
password | BAW_PASSWORD | IBM BAW password of the username before this |
Schedule_time (optional) | BAW_SCHEDULE_TIME | Choose a time within a 24-hour window to start the BAW Connector. |
Setting the schedule
In the methods to input these parameters, only the <schedule_time> variable is optional that can be accepted in a time (hours:minutes) or a cron expression format as shown after this:
Enter the scheduled time within the next 24 hours in either hours: minutes
time format(that is, 00:05 to 24:00) or cron expression:
Then, enter the time:
- 13:33
Or enter the cron expression:
- 33 13 * * *
For example, the cron expression 33 13 * * * represents the time 13:33 (1:33 PM) every day.
- */1 * * * *
The cron expression */1 * * * * represents a job that runs every minute.
If you want to specify every 5 minutes by using cron, it is based on every 5 minutes from the start of the hour, not every 5 minutes from the current time.
The advantage of using a cron expression is to have a consistent scheduled time. With cron expression, every certain time is consistent.
Running Python baw_conector py file user choose p with schedule countdown
Running Python baw_conector py file user choose p with schedule countdown ends
When the BAW data retrieval procedure is complete, the programme must terminate and the execution lifecycle must come to an end. This implies that a cron expression can be set to run once every predetermined amount of time. The schedule has a single occurrence and ends when the program is executed. The cron is only run once more when you run the BAW Connector module.
System_extract_baw_data function(interactive or system integration/automation)
This function takes configuration variables from environment variables that allows you to run the BAW module in an automated way in which the configuration variables are set as environment variables. To view the configured environment variable, see Explanation of Parameters.
There are two ways to run the BAW_Connector.py
module through the system_extract_baw_data
function. The system_extract_baw_data
function allows the BAW_Connector
module to extend and integrate
into your Python module or run the BAW_Connector.py
module in an automated way
-
Interactive mode:
Go to the
BAW-Connector
folder.cd <path to your folder>/BAW-Connector
Run the command.
python BAW_Connector.py
Choose the option: To extract BAW data based on the configuration set as environment variables, type 's'.
-
using a script: If you extend and integrate the BAW Connector module with an existing module by using a script, the existing Python module imports the
system_extract_baw\data
function from the BAW Connector module and calls thesystem_extract_baw_data(config)
function in the existing module with a config dictionary.
For example,
from main.BAW_Connector import system_extract_baw_data
config = {
...
}
if name == "main":
system_extract_baw_data(config)
Uploading the custom process app to IBM Process Mining
After using the BAW Connector to generate your CSV file, you can use the BAW Process App to extract, transform, and load the process data.
The BAW Process App and Connector supports the BAW version 23.0.2.
To access the Process App services for BAW, do the following steps:
-
From the home page, click Start from a process app.
-
In the Process App page, click Import Process App from file.
-
Upload the BAW Business
Process Management.pma
file in the Process App dialog box and click Create. The Process App is created.
Creating a process by using the BAW process management app
To create the process app, complete the following steps:
-
In the Process applications page, click Get Started on the BAW process management tile.
-
In the Process details step, complete the following steps:
a. Enter the name of your process.
b. Optional: Link your process to an organization.
-
If you want to link your process to an existing organization, select the Use existing organization option and select an organization name from the list.
-
If you want to link your process to a new organization, select the Create new organization option and enter the name of the new organization.
c. Click Next to go to the Documentation step.
To gather data from the BAW Process App, you must download and configure the BAW connector/extractor code script to extract the BAW raw data from the BAW application. After you execute these steps, click Next to go to the Configuring event logs step.
If you did not execute these steps, then select Help me gather my data.
Click Download
.gz
file to access the Python script to extract process data from a BAW application.After the execution is complete, a
.gz
file (which contains a CSV file of the BAW process data from the BAW application) is created in the location that you specify during that configuration and execution of the connector/extractor script. The.gz
file is needed to proceed to the next step. After you have the.gz
file, click Next to go to the Configuring event logs step. -
-
Configuring Event Logs
In the configuration event logs, you can add any process or task data into the CSV.
In the Configuring Event Logs, select Include exposed variables checkbox to include the exposed process variables. The field name of each tracked variable in the Process Mining data source starts with 'trkd'.
For example,
trkd.requisition.requester
With the business data text area, you can list other process or task data that is separated with a comma (,).
For example,
requisition.requester,currentPosition.jobTitle,currentPosition.replacement.lastName
The field name of each of these variables in the Process Mining data source starts with 'tsk'.
For example,
tsk.requisition.requester, tsk.currentPosition.jobTitle, tsk.currentPosition.replacement.lastName
After you choose what to include, click Next to upload your
.csv
raw data that is extracted by using the BAW connector.The following image is from a BAW application for reference on where the task data and exposed variables are sourced from.
Date type values from BAW are in the ISO8601 format, for example, 2011-08-04T03:12:53Z
.
To work with IBM Process Mining NextGen, the format is changed to “%Y-%m-%d %H:%M:%S” through a function within BAW_process_app.py
, which is the logic file within your BAW Process App. The format_dates
function finds
the columns and updates their values by filtering the names containing date
or Time
. The search is case sensitive.
If your results include any Date
type columns that do not match the date
or Time
names, you might need to edit the Process App logic file. The columns can come from tracked or untracked variables.
The Process App logic file has a list of substrings that the columns are checked for:
def format_dates(event_list: pl.DataFrame) -> pl.DataFrame:
#case sensitive list of substrings to watch out for in column names
columns_search_text = [ "date", "Time"]
You must add the columns_search_text
substring to the file. Use the affected column name or a substring of that name if you need to apply the date formatting to multiple columns.
-
Loading your data
Drag and drop your
.gz
file or click upload to see the Folder window. Go to the file path in which you generated thezip
file that contains the extracted data from BAW connector/extractor and upload it here.
The Process App then validates the data to validate that the data can be uploaded. After Process App completes validating the data, click Next to go to the Generate your process step.
-
Generating your process.
In Generate your process step, IBM Process Mining generates a process based on the data that you upload in the Load your data step. You can see the progress of the generated process in any of the following statuses: PENDING, IN PROGRESS, completed, and ERROR. Each of the statuses is applicable under the following stages in the Generate your process step:
-
Transforming your data
-
Generating event log
-
Applying default analysis
-
Finalizing the process
Click Finish to go to the IBM Process Mining Processes dashboard. The process generation runs in the background. When the Process App completes the process generation, you can see the new process that is created in the process list on the Processes dashboard.
If you stay on the same window to view the progress of the process generation till the end, you see the status of each of the stages that are marked as completed.
Click Finish to view your process on the process model tab.
-
Viewing the event log configuration
You can view the event log configurations for the process-mining project that you created by using the BAW business module Process App. To view the user input or the event log configurations, complete the following steps:
- Go to Home page > All projects.
- Select the process mining project that you created by using the process app.
- Go to Data & Settings > Process App to view the event log configurations in the User inputs (Event logs configurations) section.