Skip to content

Commit

Permalink
Fix 'Get Processinstance Result'
Browse files Browse the repository at this point in the history
  • Loading branch information
moellenbeck committed Nov 2, 2024
1 parent aaac8f2 commit e110997
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
13 changes: 2 additions & 11 deletions ProcessCubeLibrary/keywords/process_instance_keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,8 @@ def get_processinstance(self, **kwargs) -> FlowNodeInstanceResponse:
def get_processinstance_result(self, **kwargs) -> Dict[str, Any]:
result = self._get_processinstance(**kwargs)

if result and len(result.tokens) > 0:
payload = result.tokens[0]['payload']
if payload is not None:
try:
logger.info(f"type(payload) {type(payload)}")
if type(payload) in [str, bytes]:
payload = json.loads(payload)
else:
pass
except json.decoder.JSONDecodeError:
payload = {}
if result:
payload = result.end_token
else:
payload = {}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wheel==0.44.0
processcube-client==4.0.0
processcube-client==4.1.3
#docker==6.1.3
docker==7.1.0
requests>=2.31.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setuptools.setup(
name="robotframework-processcube",
version=setuptools.sic('5.0.2'),
version=setuptools.sic('5.0.5'),
description="Robot Framework Keywords for processcube workflow engine.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
5 changes: 2 additions & 3 deletions tests/03_get_the_process_instance_result.robot
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ Start process model
${PROCESS_INSTANCE}= Start Processmodel hello_delayed_result ${PAYLOAD}
Set Suite Variable ${CORRELATION} ${PROCESS_INSTANCE.correlation_id}
Log ${CORRELATION}
Log To Console ${CORRELATION}

Get the process instance
Sleep 2s # Wartet 2 Sekunden
${RESULT} Get Processinstance Result correlation_id=${CORRELATION} max_retries=10 delay=1 backoff_factor=1
Log ${RESULT}
# ${RESULT} = {'foo': 'bar', 'hello': 'world'}
#Should Be Equal ${RESULT} foo=bar hello=world
&{EQ_RESULT}= Create Dictionary foo=bar hello=world
Should Be Equal ${RESULT} ${EQ_RESULT}

0 comments on commit e110997

Please sign in to comment.