Package: robotframework-camunda
Robot Framework CamundaThis library provides keywords for accessing camunda workflow engine. Complete REST API reference of camunda
can be foundhere.Please reviewissue boardfor
known issues or report one yourself. You are invited to contribute pull requests.DocumentationKeyword documentation is providedhereInstallationThe library is published onpypi.organd can be installed with pip:pipinstallrobotframework-camundaRunning robotframework-camundaThetestsfolder 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:dockerrun-d--namecamunda-p8080:8080camunda/camunda-bpm-platform:run-latestDeploy 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.htmlStarting 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 thatfetchesa workload from camunda, processes it and
returns its workload back to camunda duringcompletion. Main keywords involved are:CamundaLibrary.Fetch workloadCamundaLibrary.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}AuthenticationPrerequisite: CamundaLibrary >= 2.0If your Camunda Platform REST API requires authentication (it should at least in production!) then you do not need to pass the host url to CamundaLibrary during intialization. You require theSet Camunda Configurationkeyword. The keyword expects a dictionary with host url and (optional) either username with password or api key with optional api key prefix. See the following example.*** Settings ***
Library    CamundaLibrary


*** Test Cases ***
Demonstrate basic auth
    ${camunda_config}    Create Dictionary    host=http://localhost:8080    username=markus    password=%{ENV_PASSWORD}
    Set Camunda Configuration    ${camunda_config}
    ${deployments}    Get deployments    #uses basic auth now implictly

Demonstrate Api Key
    ${camunda_config}    Create Dictionary    host=http://localhost:8080    api_key=%{ENV_API_KEY}   api_key_prefix=Bearer
    Set Camunda Configuration    ${camunda_config}
    ${deployments}    Get deployments    #uses api key implicitlyIf you would pass in username+passwordandand API key, the API key will always be chosen over the username+password. So better leave it out for not confusing everybody.