Skip to content

Commit

Permalink
document "download file from variable"
Browse files Browse the repository at this point in the history
Closes #66
  • Loading branch information
Noordsestern committed Apr 5, 2022
1 parent e3de222 commit 6f40064
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CamundaLibrary/CamundaLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def get_deployments(self, deployment_id: str = None, **kwargs):
@keyword(tags=['message'])
def deliver_message(self, message_name, **kwargs):
"""
Delivers a message using Camunda REST API: https://docs.camunda.org/manual/7.15/reference/rest/message/post-message/
Delivers a message using Camunda REST API: https://docs.camunda.org/manual/latest/reference/rest/message/post-message/
Example:
| ${result} | deliver message | msg_payment_received |
Expand Down Expand Up @@ -333,7 +333,7 @@ def fetch_workload(self, topic: str, async_response_timeout=None, use_priority=N
`Get Fetch Response`
The only mandatory parameter for this keyword is *topic* which is the name of the topic to fetch workload from.
More parameters can be added from the Camunda documentation: https://docs.camunda.org/manual/7.14/reference/rest/external-task/fetch/
More parameters can be added from the Camunda documentation: https://docs.camunda.org/manual/latest/reference/rest/external-task/fetch/
If not provided, this keyword will use a lock_duration of 60000 ms (10 minutes) and set {{deserialize_value=True}}
Expand Down Expand Up @@ -548,6 +548,15 @@ def complete_task(self, result_set: Dict[str, Any] = None, files: Dict = None):

@keyword(tags=['task', 'variable', 'file'])
def download_file_from_variable(self, variable_name: str) -> str:
"""
For performance reasons, files are not retrieved automatically during `fetch workload`. If your task requires
a file that is attached to a process instance, you need to download the file explicitly.
Example:
| ${variables} | *fetch workload* | _first_task_in_demo_ |
| | *Dictionary Should Contain Key* | _${variables}_ | _my_file_ |
| ${file} | *Download File From Variable* | ${variables}[my_file] | |
"""
if not self.FETCH_RESPONSE:
logger.warn('Could not download file for variable. Maybe you did not fetch and lock a workitem before?')
else:
Expand Down

0 comments on commit 6f40064

Please sign in to comment.