Exercise: Exception handling

During the previous exercises we have build a process generating certificates of participation for the workshop attendees. Unfortunately, at the production, we face issues with the data we get from the participants API. Also, we don’t have consent from all of the participants to email the certificates digitally.

This exercise is about handling these exceptions. This is all about modeling, and requires no changes for the previously implemented robots.



Randomly missing data

The following Mockoon template would randomly leave empty values for fields firstname and lastname:

  "users": [
    {{# repeat (queryParam 'total' '10') }}
        {{#if (faker 'datatype.boolean')}}
        "firstname": "{{ faker 'name.firstName' }}",
        "lastname": "{{ faker 'name.lastName' }}",
        "firstname": "",
        "lastname": "",
        "email": "{{ faker 'internet.email' }}",
        "consent": {{ faker 'datatype.boolean' }},
        "achievements": {{{ faker 'helpers.arrayElements' }}}
    {{/ repeat }}
  "total": "{{queryParam 'total' '10'}}"

Resource summary