Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use robot.utils.DotDict instead of dict #79

Open
Noordsestern opened this issue Apr 5, 2022 · 0 comments
Open

Use robot.utils.DotDict instead of dict #79

Noordsestern opened this issue Apr 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Noordsestern
Copy link
Member

robot.utils.DotDict supports dot-notation in order to access values in dictionaries: ${process.id} instead of only ${process}[id]

from robot.utils import DotDict

@keyword("Get fetch response", tags=['task'])
    def get_fetch_response(self):
        """Returns cached response from the last call of `fetch workload`.

        The response contains all kind of data that is required for custom REST Calls.

        Example:
            | *** Settings *** |
            | *Library* | RequestsLibrary |
            | |
            | *** Tasks *** |
            | | *Create Session* | _alias=camunda_ | _url=http://localhost:8080/_ |
            | | ${variables} | *fetch workload* | _my_first_task_in_demo_ | |
            | | ${fetch_response} | *get fetch response* | | |
            | | *POST On Session* | _camunda_ | _engine-rest/external-task/${fetch_response}[id]/complete_ | _json=${{ {'workerId': '${fetch_response}[worker_id]'} }}_ |
        """
        if self.FETCH_RESPONSE:
            return DotDict(self.FETCH_RESPONSE.to_dict())
        return self.FETCH_RESPONSE
@Noordsestern Noordsestern added the enhancement New feature or request label Apr 5, 2022
@Noordsestern Noordsestern linked a pull request Apr 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant