{
  "format": "rpai-station-workflow",
  "version": 1,
  "name": "Variables and text",
  "variables": [],
  "activities": [
    {
      "id": "academy-001",
      "type": "comment",
      "name": "About this workflow",
      "properties": {
        "text": "Station Academy, Level 3. Variables, text operations and simple maths. Touches no other app."
      }
    },
    {
      "id": "academy-002",
      "type": "set_variable",
      "name": "Customer name",
      "properties": {
        "variableName": "customer",
        "valueType": "static",
        "value": "  example ltd  "
      }
    },
    {
      "id": "academy-003",
      "type": "string_operation",
      "name": "Remove extra spaces",
      "properties": {
        "operation": "trim",
        "input": "{{customer}}",
        "saveToVariable": "customer"
      }
    },
    {
      "id": "academy-004",
      "type": "string_operation",
      "name": "Capital letters",
      "properties": {
        "operation": "uppercase",
        "input": "{{customer}}",
        "saveToVariable": "customerUpper"
      }
    },
    {
      "id": "academy-005",
      "type": "string_operation",
      "name": "Count characters",
      "properties": {
        "operation": "length",
        "input": "{{customer}}",
        "saveToVariable": "nameLength"
      }
    },
    {
      "id": "academy-006",
      "type": "string_operation",
      "name": "Replace a word",
      "properties": {
        "operation": "replace",
        "input": "{{customer}}",
        "find": "ltd",
        "replaceWith": "Limited",
        "saveToVariable": "customerLong"
      }
    },
    {
      "id": "academy-007",
      "type": "set_variable",
      "name": "Units",
      "properties": {
        "variableName": "units",
        "valueType": "static",
        "value": "12"
      }
    },
    {
      "id": "academy-008",
      "type": "set_variable",
      "name": "Unit price",
      "properties": {
        "variableName": "price",
        "valueType": "static",
        "value": "3.5"
      }
    },
    {
      "id": "academy-009",
      "type": "math_operation",
      "name": "Units times price",
      "properties": {
        "operation": "multiply",
        "operand1": "units",
        "operand2": "price",
        "saveToVariable": "total"
      }
    },
    {
      "id": "academy-010",
      "type": "math_operation",
      "name": "Round the total",
      "properties": {
        "operation": "round",
        "operand1": "total",
        "saveToVariable": "rounded"
      }
    },
    {
      "id": "academy-011",
      "type": "log",
      "name": "Show the results",
      "properties": {
        "message": "{{customerUpper}} ({{nameLength}} characters), also written {{customerLong}}: {{units}} x {{price}} = {{total}}, rounded {{rounded}}",
        "level": "info"
      }
    }
  ]
}
