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.

../_images/create-certificate1.svg

create-certificate.bpmn

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' }}",
        {{else}}
        "firstname": "",
        "lastname": "",
        {{/if}}
        "email": "{{ faker 'internet.email' }}",
        "consent": {{ faker 'datatype.boolean' }},
        "achievements": {{{ faker 'helpers.arrayElements' }}}
      },
    {{/ repeat }}
  ],
  "total": "{{queryParam 'total' '10'}}"
}

Resource summary

create-certificate.bpmn
participant-info.formparticipant-info.json
../mockoon/workshop-achievement.dmn../mockoon/workshop-achievement.html
   ../email/create-certificate.zip
   ../mockoon/fetch-participants.zip
   ../spreadsheet/summary-sheet.zip