Skip to content

Collection of keywords integrating Robot Framework and Camunda

License

Notifications You must be signed in to change notification settings

postadress/robotframework-camunda

 
 

Repository files navigation

PyPI status pipeline status PyPi license PyPi version PyPI pyversions PyPI download month

Robot Framework Camunda

This library provides keywords for accessing camunda workflow engine. Complete REST API reference of camunda can be found here.

Please review issue board for known issues or report one yourself. You are invited to contribute pull requests.

Documentation

Keyword documentation is provided here

Installation

The library is published on pypi.org and can be installed with pip:

pip install robotframework-camunda

Running robotframework-camunda

The tests folder has example robot tests for keywords already implemented. Those tests assume you already have an instance of camunda running.

Easiest way of running camunda is to launch with with docker:

docker run -d --name camunda -p 8080:8080 camunda/camunda-bpm-platform:run-latest

Deploy process definition

*** Settings ***
Library    CamundaLibrary    ${CAMUNDA_HOST}

*** Variables ***
${CAMUNDA_HOST}    http://localhost:8080
${MODEL_FOLDER}    ${CURDIR}/../models

*** Test Cases ***
Test deployment of a single model in 1 deployment
    ${response}    deploy    ${MODEL_FOLDER}/demo_for_robot.bpmn

Test deployment of several models in 1 deployment
    ${response}    deploy    ${MODEL_FOLDER}/demo_for_robot.bpmn    ${MODEL_FOLDER}/demo_embedded_form.html

Starting a process instance

*** Settings ***
Library    CamundaLibrary    ${CAMUNDA_HOST}

*** Variables ***
${CAMUNDA_HOST}    http://localhost:8080

*** Test Cases ***
Test starting process
    #GIVEN
    ${process_definition_key}    Set Variable    demo_for_robot

    # WHEN
    ${process_instance}    start process    ${process_definition_key}

Execute Task

"Executing task" bascialy means, you execute a robot task that fetches a workload from camunda, processes it and returns its workload back to camunda during completion. Main keywords involved are:

  1. CamundaLibrary.Fetch workload
  2. CamundaLibrary.Complete Task
*** Settings ***
Library    CamundaLibrary    ${CAMUNDA_HOST}
Library    Collections

*** Variables ***
${CAMUNDA_HOST}    http://localhost:8000
${existing_topic}    process_demo_element

*** Test Cases ***
Process workload
    ${variables}    fetch workload   topic=${existing_topic}
    ${recent_task}    Get fetch response
    log    Recent task:\t${recent_task}

    Pass Execution If    not ${recent_task}    No workload fetched from Camunda
 
    # do some processing
    
    # create result and return workload to Camunda
    ${my_result}    Create Dictionary    lastname=Stahl
    complete task   ${my_result}

About

Collection of keywords integrating Robot Framework and Camunda

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 57.2%
  • RobotFramework 42.1%
  • Other 0.7%