{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "unitOfMeasure",
            "variableName": "unitOfMeasure"
          },
          {
            "children": [
              {
                "command": "Disable",
                "widgetName": "txtCode"
              }
            ],
            "command": "If",
            "expression": "IsNotNull(^unitOfMeasure) && IsNotNull(^unitOfMeasure.id)"
          },
          {
            "children": [
              {
                "command": "Enable",
                "widgetName": "txtCode"
              }
            ],
            "command": "Else"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "unitOfMeasure",
            "type": "ExtCommonBusiness.UnitOfMeasure"
          }
        ]
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "unitOfMeasure",
            "variableName": "unitOfMeasure"
          },
          {
            "children": [
              {
                "command": "Throw",
                "errorName": "Error",
                "expressionData": "\"[[ErrorFillingFormTitle]]\"",
                "expressionInnerError": "\"[[ErrorFillingFormMsg]]\""
              }
            ],
            "command": "If",
            "expression": "IsNull(^unitOfMeasure)"
          },
          {
            "children": [
              {
                "command": "Execute",
                "expression": "ExtCommonBusiness.UpdateUnitOfMeasure(^unitOfMeasure.id, ^unitOfMeasure)"
              }
            ],
            "command": "If",
            "expression": "IsNotNull(^unitOfMeasure) && IsNotNull(^unitOfMeasure.id)"
          },
          {
            "children": [
              {
                "command": "Execute",
                "expression": "ExtCommonBusiness.CreateUnitOfMeasure(^unitOfMeasure)"
              }
            ],
            "command": "Else"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "unitOfMeasure",
            "type": "ExtCommonBusiness.UnitOfMeasure"
          }
        ]
      },
      "name": "main_submit"
    }
  ],
  "model": [
    {
      "name": "unitOfMeasure",
      "required": false,
      "type": "ExtCommonBusiness.UnitOfMeasure"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "children": [
              {
                "binding": "unitOfMeasure.code",
                "label": "[[Code]]",
                "last": true,
                "name": "txtCode",
                "size": 2,
                "widget": "TextBox"
              },
              {
                "binding": "unitOfMeasure.name",
                "label": "[[Name]]",
                "last": true,
                "name": "txtName",
                "size": 2,
                "widget": "TextBox"
              }
            ],
            "cssClass": "blz-border-top blz-border-right blz-border-left blz-border-radius blz-cast-shadow",
            "layout": "form"
          }
        ],
        "cssClass": "blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large",
        "layout": "responsive"
      }
    ],
    "cssClass": "blz-area-default",
    "layout": "fit"
  },
  "routing": null,
  "unused": []
}