# id: It represents the id of the process
# string, required
# allows letters, numbers and underscores only (should start with a letter)
key: processExample2

# type: Should be "process" for processes
# required, string
type: process

# name: Describes the name of the process
# string, required
name: Start Recruitment

# icon: font-awesome icon
# string, optional
icon: person

# mainTable: Describes the table that will affect this process
# string, required
mainTable: Recruiters

summary:
  title: Process for {{identificationNumber}}

# permissions: Defines the permissions for this process. Probably it should be moved to its own schema.
# object, optional
permissions: {}

# field groups allows to easily repeat fields that are common to multiple forms
# optional, object
fieldGroups: {}

# Defines the forms used by this process
# object, optional
forms:
  fillOutInvitationInformation:
    name: Fill out invitation form
    rows:
      - identificationNumber
  fillOutScores:
    name: Fill out scores
    rows:
      - identificationNumber
serviceTasks:
  calculateScore:
    name: Calculate score
    type: httpRequest
    retries: 3
    method: POST
    url: http://example.com/myEndpoint/{{identificationNumber}}
    query:
      a: any text
      b: "{{identificationNumber}}"
      d: "{{_secrets.mySecret}}"
      e: "{{_vars.initiator.id}}"
      f: A mix of anything {{_vars.initiator.email}} {{_secrets.abc}}
    headers:
      Authorization: Bearer {{_secrets.myToken}}
    body:
      myKey: myValue
      anotherKey: "{{_secrets.mySecret}}"
    mapping:
      _vars.response: "{{body}}"
      identificationNumber: "{{body.data.score}}"
      _vars.statusCode: "{{statusCode}}"
      _vars.expireDate: "{{headers.expires}}"
  test:
    name: Calculate score
    type: httpRequest
    retries: 3
    method: POST
    url: http://example.com/myEndpoint/{{identificationNumber}}
    query:
      a: any text
      b: "{{identificationNumber}}"
      d: "{{_secrets.mySecret}}"
      e: "{{_vars.initiator.id}}"
      f: A mix of anything {{_vars.initiator.email}} {{_secrets.abc}}
    headers:
      Authorization: Bearer {{_secrets.myToken}}
    body: "Bearer token {{_vars.myVar}} {{_secrets.secret2}}"
