Robotic Process Automation in Windows and Linux by using Driagrams.net BPMN diagrams.

Overview

BPMN_RPA

Robotic Process Automation in Windows and Linux by using BPMN diagrams.

With this Framework you can draw Business Process Model Notation based Diagrams and run those diagrams with a WorkflowEngine. You can run flows that were made with one of the following programs:

There is no need for installing BPMN-RPA Studio, DrawIO or Visio to run the flows. Installing one of these applications is only needed for creating the flows.

Content:

Quick start

  • Open the application for creating the flow (BPMN-RPA Studio, diagram.net, DrawIO desktop app or Ms Visio)
  • For Draw.io only: Import the BPMN RPA Shape library ( file -> open library, which you can download for DrawIO here and for MsVisio here)
  • Create your Diagram in BPMN-RPA Studio, in https://app.diagrams.net/ or in the Desktop application (DrawIO or Ms Visio) by using the appropriate BPMN_RPA Shape-set
  • Save your diagram (as .flw for BPMN-RPA Studio, as XML for DrawIO or as vsdx for Visio)
  • You have several options to run your workflow:
    • by generating a single Python script in BPMN-RPA Studio that can contains both the code to start the WorkflowEngine as the flow steps itself
    • by using the BPMN_RPA_Starter.py
    • start the flow with the WorkflowEngine in code

First start

The first time you will try to run a Flow, you will be asked to enter the path of your install directory. If you are using Windows, the path of the install directory will be saved in the registry (path saved in registry key 'HKEY_CURRENT_USER\Software\BPMN_RPA\dbPath') and is used to create a SQLite database for logging purposes, called 'Orchestrator.db'. The WorkflowEngine must also know where your python.exe is located. You will be asked to enter the full path to the python.exe file (including the '.exe' extension). Again, if you are using Windows this path will be saved in registry key 'HKEY_CURRENT_USER\Software\BPMN_RPA\PythonPath'. For Linux users a "settings" file together with the orchestrator database will be created.

Recognized Shapes

For the Workflow engine to recognize the flow, you must use the recommended shape attributes with the following Shapes:

Tasks

You can use Tasks to call Python scripts. For the WorkflowEngine to recognize the Tasks, each Task has to contain certain attributes to make this possible.

  • Recommended attributes:

    • Module: This is the full path to the Python file that contains your Class and/or function.
      • From file: specify the full path (including extension .py) if you want to load you module from a specific file location.
      • From file in Script directory: specify only the module name (including extension .py) of the module you want to use.
      • From installed package: specify only the module name (without extension .py).
      • No Module field: you can delete the Module field to call a function in the WorkflowEngine class directly.
    • Class: for reference to the Class to use in the Module. You can delete this field if the called module has only functions and no class.
    • Function: The name of the Function to Call. This field is mandatory.
    • Output_variable: The name of the variable that must store the output of the current action. If you don't use this field (or delete it), the current Task will have no output that can be used by other Tasks.
  • Optional attributes:

    • You can specify any input value for the called function directly by adding an extra attribute to the shape with exactly the same name as the expected input parameter(s) of the function.

    P.e.: to call

      os.system('Notepad')

    You look up the name of the input parameter(s) in the official documentation (or in the code). In this example, the input parameter is called 'command'. You then set the following attributes:

GateWays
  • For now you can only use the Exclusive Gateway and the Parallel Gateway. These Gateways must have a Data attribute named 'Type' with the value 'Exclusive Gateway' or 'Parallel Gateway' respectively. The use of the Parallel Gateway is momentarely restricted to transform multiple inputs into one output. At this moment multiple outputs are not yet allowed.
Sequence flow arrow
  • If the Sequence flow arrow is originating from an Exclusive Gateway, the Sequence flow arrow must have a value of 'True' or 'False'.

Variables

The % sign is used as brackets around a Variable. For example, "%name%" is the Variable 'name'. When you use %name% as an input, the Action will use the value that has previously been stored in that Variable, so you should have an earlier Action that assigned a value to %name% as an output. By assigning output values to Variables, and then using them as input in later steps, you can pass information through a Workflow.

You can store any type of information into a variable, like:

  • Texts
  • Numbers
  • Booleans
  • Lists
  • Dictionary
  • Class objects
    etc. etc.
System variables

System variables are pre-defined variables that provide information that can be used in flow attributes. The System variables content is set by the WorkflowEngine automatically and cannot be changed. All system variables begin with a double underscore between precent signs. Available variables:

  • %__folder_desktop__%: returns the desktop folder of the current user
  • %__folder_downloads__%: returns the downloads folder of the current user
  • %__folder_system__%: returns the windows system folder
  • %__month__%: returns the current month
  • %__now__%: returns the datetime now() object
  • %__now_formatted__%: returns today with time in the format 'dd-mm-yyyy_hhmmss'
  • %__time__%: returns the current time
  • %__time_formatted__%: returns the current time in 'hh:mm:ss' format
  • %__today__%: returns the current date
  • %__today_formatted__%: returns the current date in 'dd-mm-yyyy' format
  • %__tomorrow__%: returns the date of tomorrow
  • %__tomorrow_formatted__%: returns the date of tomorrow in 'dd-mm-yyyy' format
  • %__user_name__%: returns the account name of the user that is currently logged in
  • %__weeknumber__%: returns the current weeknumber
  • %__year__%: returns the current year number
  • %__yesterday__%: returns the date of yesterday
  • %__yesterday_formatted__%: returns the date of yesterday in 'dd-mm-yyyy' format

Loops

You can create loops by using exclusive gateways. An exclusive gateway should always have two sequence flow arrows: one with the label "True" and the other with the label "False". The actual true/false decision isn't made in the exclusive gateway itself, but in the last Task before the exclusive gateway. A loop is started by a Task that is calling a Python script that returns a list. The task is recognized as the start of the loop by adding/using the attribute 'Loopcounter'. The loopcounter number is the starting point for the loop (for returning the n-th element of the list). The task before the Exclusive Gateway should be the 'More loop items?' Task. You can find this Task in the predefined Shapes. This Task should have two attributes: 'Function' with value 'loop_items_check' will call the loop_items_check() function in the WorkflowEngine object, and 'Loop_variable' with the variable name to loop as value. The loop_items_check() function will return True or False, which will be used by the WorkflowEngine to decide which Sequence Flow Arrow to follow.

Special loop variable options

You can get the value of the loopvariable counter by using the '.counter' attribute of the loopvariable (p.e.: %test.counter%). To get the whole list that is looped, use the '.object' attribute of the loopvariable (p.e.: '%test.object%') or just the variable name (like '%test%').

An example:

Explanation:

  1. The loop starts with the 'Loop list' Task. This The function 'returnlist' is called in the module 'hello_world.py'. There is no path specified for the module and the module name ends with '.py', so the path to the module will be 'current directory\Scripts\hello_world.py'. This script returns a List with the elements ["this", "is", "a", "test"] and stores it in the variable named '%test%'. The attribute 'Loopcounter' is the important indication that this Task will be the start of a loop. The number in this field will be the start for the loop (p.e.: setting 'Loopcounter' to 1 results in loping the list from the second element in the list).
  2. The MessageBox function is called ('current directory\Scripts\MessageBox.py'). The title will be "test", and the message will be a word from the list in confirmity with the 'Loopcounter' number ('%test%').


  3. The 'More loop items?' Task checks if the List in the variable '%test%' has any items left to loop. If so, then it returns True, otherwise it will return False. If it returns True, the 'Loopcounter' is raised by 1. The function is called within the WorkflowEngine class (no 'Module'or 'Class' specified).
  4. The Exclusive Gateway is deciding which Sequence Flow Arrow to follow. If the loop is still ongoing, the 'Loop List' Task will be called again and the next element in the list will be returned.

Retreiving information

In order to retrieve a specific item of a list, you must use the following format (notation): %VariableName[ItemNumber]%. The “ItemNumber” should be 0 for the first item of the list, 1 for the second and so on. For example, if you have a list that is stored in the variable %MyList% and contains 10 items, you can retrieve the first item with: %MyList[0]% and the last item with %MyList[9]%. For data tables, you must use the following notation: %VariableName[RowNumber][ColumnNumber]%.

If you would like to retreive an attribute of a stored object or dictionary in a variable, then you must use the %VariableName.attributeName% notation. Just use the %VariableName% notation to retreive the full object or dictionary.

Instantiate a Class and use in Flow

You can instantiate a Python class by using ony these attributes (leave the 'Function' attribute blank or delete it):

This instantiates the class and saves the instance in the variable %test%. You can call any function of the class object by use of these attributes in Tasks following the instantiation Task (leave the 'Module' attribute blank or delete it):

Passing input to the WorkflowEngine

You can pass input to the WorkflowEnging by using the 'input_parameter' argument. Please note that it is only possible to pass a single object to the WorkflowEngine. Wrap all your inputs into a single object (like: dictionary or custom object) to pass multiple values to the WorkflowEngine.

myObject = ['this could be', 'any', 'type', 'of', 'object']
engine = WorkflowEngine(input_parameter=myObject)

Call the internal 'get_input_parameter' function to retreive this input value and assign it to a variable name for later use in your flow:

When starting a Workflow from the commandline, you may use the 'As_ditcionary' option in the 'Get input paramater' Shape of your Flow with the value 'True' to convert the string input to a dictionary object. P.e.:

c:\> python BPMN_RPA_Starter.py test.xml "{\"key1\": \"value1\",\"key2\": \"value2\"}"

Logging

The WorkflowEngine logs all executed steps in a SQLite database, called 'Orchestrator.db'. This database is located in the install directory. If the install directory is unknown when starting the WorkflowEngine, the WorkflowEngine will ask you for the folder. This path then will be saved in the registry and the Orchestrator database will be created in that folder.

End a flow

The ending of a flow will also be logged in the Orchestrator database. When ending a flow, the output of the last executed step will also be the output of the entire flow, unless the flow is ended with an exitcode.

End flow with exitcode

If you wish to end your flow with an exitcode (0 for OK and -1 for not OK) then you can call one of the internal functions of the WorkflowEngine:

  • exitcode_ok
  • exitcode_not_ok

Just call one of the above functions by only passing the 'function' parameter (thus not passing the 'Module' and 'Class' parameter):

Step by step flow execution

As from BPMN-RPA version 4.x.x and above, you can perform step-by-step flow execution in your code. An example:

engine = WorkflowEngine()
doc = engine.open("c:\\test.flw")
steps = engine.get_flow(doc)
nextstep = steps[0]
while nextstep is not None:
    q = input("Execute next step? (y/n)")
    if q.lower()!="y":
        break
    print("\n")
    result =  engine.run_flow(nextstep,True )
    nextstep = engine.get_next_step(nextstep, steps, result)
    print(f"Output of this step: {result}")

PlugIn

BPMN-RPA has a Drawio plugin for checking your flows. You can download it here: PlugIn

Example

Start a flow from the commandline:

  1. Open a command prompt
  2. Enter:
c:\> python BPMN_RPA_Starter.py test.xml

Start a flow in code:

engine = WorkflowEngine()
doc = engine.open("test.xml")
steps = engine.get_flow(doc)
engine.run_flow(steps)

You can download the DrawIO desktop version here

Comments
  • Json error while trying to execute .flw file

    Json error while trying to execute .flw file

    I am executing the below piece of code.

    from BPMN_RPA.WorkflowEngine import WorkflowEngine engine = WorkflowEngine(input_parameter=None,pythonpath="E:\Anaconda3_new\python.exe",installation_directory="E:\businessrules\Signature Automation\Config") doc = engine.open("E:\businessrules\Signature Automation\Config\rial_2.flw") steps = engine.get_flow(doc) nextstep = steps[0] while nextstep is not None: q = input("Execute next step? (y/n)") if q.lower()!="y": break print("\n") result = engine.run_flow(nextstep,True ) nextstep = engine.get_next_step(nextstep, steps, result) print(f"Output of this step: {result}")

    when i am trying to execute using python bpmn.py i am getting below error

    doc = engine.open("E:\businessrules\Signature Automation\Config\rial_2.flw") File "E:\Anaconda3_new\envs\mlops\lib\site-packages\BPMN_RPA\WorkflowEngine.py", line 203, in open dict_list = json.loads(decoded) File "E:\Anaconda3_new\envs\mlops\lib\json_init_.py", line 357, in loads return _default_decoder.decode(s) File "E:\Anaconda3_new\envs\mlops\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "E:\Anaconda3_new\envs\mlops\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    opened by catchlui 8
  • BPMN_RPA Studio tcl-related error and fix

    BPMN_RPA Studio tcl-related error and fix

    ISSUE: Running flow from Studio gives init.tcl related error. STEPS TO DUPLICATE: Run flow. image image WORKAROUND:

    1. Create folder "C:\Lib"
    2. From Python program folder copy tcl8.6 and tk8.6 folders to C:\Lib (for me, C:\Program Files\Python37\tcl\tcl8.6\ and C:\Program Files\Python37\tcl\tk8.6)

    Flows should now run correctly.

    opened by burque505 1
  • BPMN_RPA Studio not running flows

    BPMN_RPA Studio not running flows

    ISSUE: Flows will not execute from Studio DESCRIPTION: Flows will not execute from Studio STEPS TO REPRODUCE:

    1. Install BPMN-RPA Studio 4.6.1 on Win10 Pro 64-bit.
    2. Create simple flow with one Message
    3. Run from Studio
    4. Should fail.

    TROUBLESHOOTING:

    1. Where flow is named "flow2.flw", copy BPMN_RPA_STARTER.py to flow directory, rename as test.py
    2. Run from cmd.exe "python test.py flow2.flw"
    3. Output indicates module "xmlt2dict" is missing.

    C:\BPMN-RPA Studio\Git>python test.py flow2.flw Traceback (most recent call last): File "test.py", line 1, in <module> from BPMN_RPA.WorkflowEngine import WorkflowEngine File "C:\Program Files\Python37\lib\site-packages\BPMN_RPA\WorkflowEngine.py", line 22, in <module> import xmltodict ModuleNotFoundError: No module named 'xmltodict'

    FIX: pip install --upgrade xml2dict SUGGESTION: Add xml2dict as dependency

    opened by burque505 1
  • Settings file Error (debian)

    Settings file Error (debian)

    Hello, When I have tried to run the first flow:

    python3 BPMN_RPA_Starter.py flux.xml

    I get the next error:

    Traceback (most recent call last): File "BPMN_RPA_Starter.py", line 13, in engine = WorkflowEngine(input_parameter=input_parameter) File "/usr/local/lib/python3.7/dist-packages/BPMN_RPA/WorkflowEngine.py", line 54, in init with open('settings') as json_file: FileNotFoundError: [Errno 2] No such file or directory: 'settings'

    The first time when I tried to run the flow the path of the installation has not been asked.....

    "First start The first time you will try to run a Flow, you will be asked to enter the path of your install directory. If you are using Windows, the path of the install directory will be saved in the registry (path saved in registry key 'HKEY_CURRENT_USER\Software\BPMN_RPA\dbPath') and is used to create a SQLite database for logging purposes, called 'Orchestrator.db'. The WorkflowEngine must also know where your python.exe is located. You will be asked to enter the full path to the python.exe file (including the '.exe' extension). Again, if you are using Windows this path will be saved in registry key 'HKEY_CURRENT_USER\Software\BPMN_RPA\PythonPath'. For Linux users a "settings" file together with the orchestrator database will be created."

    Someone has executed a flow in Debian? BR

    opened by smaj13 1
  • [Snyk] Security upgrade pyjwt from 1.7.1 to 2.4.0

    [Snyk] Security upgrade pyjwt from 1.7.1 to 2.4.0

    Snyk has created this PR to fix one or more vulnerable packages in the `pip` dependencies of this project.

    Changes included in this PR

    • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
      • requirements.txt
    ⚠️ Warning
    pykeepass 4.0.3 requires construct, which is not installed.
    msal 1.20.0 requires requests, which is not installed.
    msal 1.20.0 requires PyJWT, which is not installed.
    
    

    Vulnerabilities that will be fixed

    By pinning:

    Severity | Issue | Upgrade | Breaking Change | Exploit Maturity :-------------------------:|:-------------------------|:-------------------------|:-------------------------|:------------------------- high severity | Use of a Broken or Risky Cryptographic Algorithm
    SNYK-PYTHON-PYJWT-2840625 | pyjwt:
    1.7.1 -> 2.4.0
    | No | Proof of Concept

    Some vulnerabilities couldn't be fully fixed and so Snyk will still find them when the project is tested again. This may be because the vulnerability existed within more than one direct dependency, but not all of the affected dependencies could be upgraded.

    Check the changes in this PR to ensure they won't cause issues with your project.


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings

    📚 Read more about Snyk's upgrade and patch logic


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Use of a Broken or Risky Cryptographic Algorithm

    opened by snyk-bot 0
Owner
null
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

MIC-DKFZ 1.2k Jan 4, 2023
U-2-Net: U Square Net - Modified for paired image training of style transfer

U2-Net: U Square Net Modified for paired image training of style transfer This is an unofficial repo making use of the code which was made available b

Doron Adler 43 Oct 3, 2022
RGBD-Net - This repository contains a pytorch lightning implementation for the 3DV 2021 RGBD-Net paper.

[3DV 2021] We propose a new cascaded architecture for novel view synthesis, called RGBD-Net, which consists of two core components: a hierarchical depth regression network and a depth-aware generator network.

Phong Nguyen Ha 4 May 26, 2022
A C implementation for creating 2D voronoi diagrams

Branch OSX/Linux Windows master dev jc_voronoi A fast C/C++ header only implementation for creating 2D Voronoi diagrams from a point set Uses Fortune'

Mathias Westerdahl 481 Dec 29, 2022
This is a repository for a No-Code object detection inference API using the OpenVINO. It's supported on both Windows and Linux Operating systems.

OpenVINO Inference API This is a repository for an object detection inference API using the OpenVINO. It's supported on both Windows and Linux Operati

BMW TechOffice MUNICH 68 Nov 24, 2022
Using some basic methods to show linkages and transformations of robotic arms

roboticArmVisualizer Python GUI application to create custom linkages and adjust joint angles. In the future, I plan to add 2d inverse kinematics solv

Sandesh Banskota 1 Nov 19, 2021
Control-Robot-Arm-using-PS4-Controller - A Robotic Arm based on Raspberry Pi and Arduino that controlled by PS4 Controller

Control-Robot-Arm-using-PS4-Controller You can see all details about this Robot

MohammadReza Sharifi 5 Jan 1, 2022
ManipulaTHOR, a framework that facilitates visual manipulation of objects using a robotic arm

ManipulaTHOR: A Framework for Visual Object Manipulation Kiana Ehsani, Winson Han, Alvaro Herrasti, Eli VanderBilt, Luca Weihs, Eric Kolve, Aniruddha

AI2 65 Dec 30, 2022
YOLOv4-v3 Training Automation API for Linux

This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.

BMW TechOffice MUNICH 626 Dec 31, 2022
Facial detection, landmark tracking and expression transfer library for Windows, Linux and Mac

Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can be found in doc/documentation.html. All code in this SDK is provided according t

Luiz Carlos Vieira 7 Jul 16, 2020
A complete end-to-end demonstration in which we collect training data in Unity and use that data to train a deep neural network to predict the pose of a cube. This model is then deployed in a simulated robotic pick-and-place task.

Object Pose Estimation Demo This tutorial will go through the steps necessary to perform pose estimation with a UR3 robotic arm in Unity. You’ll gain

Unity Technologies 187 Dec 24, 2022
Axel - 3D printed robotic hands and they controll with Raspberry Pi and Arduino combo

Axel It's our graduation project about 3D printed robotic hands and they control

null 0 Feb 14, 2022
YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )

Yolo v4, v3 and v2 for Windows and Linux (neural networks for object detection) Paper YOLO v4: https://arxiv.org/abs/2004.10934 Paper Scaled YOLO v4:

Alexey 20.2k Jan 9, 2023
Train robotic agents to learn pick and place with deep learning for vision-based manipulation in PyBullet.

Ravens is a collection of simulated tasks in PyBullet for learning vision-based robotic manipulation, with emphasis on pick and place. It features a Gym-like API with 10 tabletop rearrangement tasks, each with (i) a scripted oracle that provides expert demonstrations (for imitation learning), and (ii) reward functions that provide partial credit (for reinforcement learning).

Google Research 367 Jan 9, 2023
CLIPort: What and Where Pathways for Robotic Manipulation

CLIPort CLIPort: What and Where Pathways for Robotic Manipulation Mohit Shridhar, Lucas Manuelli, Dieter Fox CoRL 2021 CLIPort is an end-to-end imitat

null 246 Dec 11, 2022
Doosan robotic arm, simulation, control, visualization in Gazebo and ROS2 for Reinforcement Learning.

Robotic Arm Simulation in ROS2 and Gazebo General Overview This repository includes: First, how to simulate a 6DoF Robotic Arm from scratch using GAZE

David Valencia 12 Jan 2, 2023
Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation

Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation Official PyTorch implementation for the paper Look

Rishabh Jangir 20 Nov 24, 2022
Building Ellee — A GPT-3 and Computer Vision Powered Talking Robotic Teddy Bear With Human Level Conversation Intelligence

Using an object detection and facial recognition system built on MobileNetSSDV2 and Dlib and running on an NVIDIA Jetson Nano, a GPT-3 model, Google Speech Recognition, Amazon Polly and servo motors, I built Ellee - a robotic teddy bear who can move her head and converse naturally.

null 24 Oct 26, 2022
Self-supervised Deep LiDAR Odometry for Robotic Applications

DeLORA: Self-supervised Deep LiDAR Odometry for Robotic Applications Overview Paper: link Video: link ICRA Presentation: link This is the correspondin

Robotic Systems Lab - Legged Robotics at ETH Zürich 181 Dec 29, 2022