Skip to content

Commit

Permalink
get java object from process instance variables - closes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvengeance committed Mar 16, 2022
1 parent 2185b17 commit 5f3e2fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CamundaLibrary/CamundaLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,11 @@ def get_process_instance_variable(self, process_instance_id: str, variable_name:

try:
response = api_instance.get_process_instance_variable(
id=process_instance_id, var_name=variable_name)
id=process_instance_id, var_name=variable_name, deserialize_value=False)
except ApiException as e:
raise ApiException(f'Failed to get variable {variable_name} from '
f'process instance {process_instance_id}:\n{e}')
return response
return CamundaResources.convert_variable_dto(response)

@keyword("Evaluate Decision", tags=['decision'])
def evaluate_decision(self, key: str, variables: dict) -> list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,41 @@ Suite Teardown Clean Up Process Instance
${CAMUNDA_HOST} http://localhost:8080
${PROCESS_INSTANCE_ID} ${EMPTY}
${RESPONSE} ${EMPTY}

${value}

*** Test Cases ***
Get Process Instance Variable
# Given
Process Instance Is Present

# When
Camunda Is Requested For Variable Of The Process Instance
Get Process Instance Variable: String
Given A value bar
Given Process Instance Is Present
When Camunda Is Requested For Variable Of The Process Instance
Then Camunda Answered With Correct Value

Get Process Instance Variable: List
Given A List bar ber bir bor bur
Given Process Instance Is Present
When Camunda Is Requested For Variable Of The Process Instance
Then Camunda Answered With Correct Value

Get Process Instance Variable: Dictionary
Given A List bar=1 ber=2
Given Process Instance Is Present
When Camunda Is Requested For Variable Of The Process Instance
Then Camunda Answered With Correct Value

# Then
Camunda Answered With Correct Value
*** Keywords ***
A Dictionary
[Arguments] &{values}
Set Test Variable ${value} ${values}
A List
[Arguments] @{values}
Set Test Variable ${value} ${values}

A value
[Arguments] ${testvalue}
Set Test Variable ${value} ${testvalue}

*** Keywords ***
Process Instance Is Present
${variable} Create Dictionary foo=bar
${variable} Create Dictionary foo=${value}
${response} Start Process demo_for_robot variables=${variable}
Set Global Variable ${PROCESS_INSTANCE_ID} ${response}[id]

Expand All @@ -36,7 +54,7 @@ Camunda Is Requested For Variable Of The Process Instance

Camunda Answered With Correct Value
Should Be True $RESPONSE Variable could not be read or is empty.
Should Be Equal ${RESPONSE.value} bar
Should Be Equal ${RESPONSE} ${value}

Clean Up Process Instance
Run Keyword If $PROCESS_INSTANCE_ID
Expand Down

0 comments on commit 5f3e2fc

Please sign in to comment.