{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goalId",
            "variableName": "goalId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "mainGoalId",
            "variableName": "mainGoalId"
          },
          {
            "command": "Set",
            "expression": "{}",
            "variableName": "edition"
          },
          {
            "command": "Set",
            "expression": "{}",
            "variableName": "assignment"
          },
          {
            "command": "GetValue",
            "variableName": "assignment.type",
            "widgetName": "cboType"
          },
          {
            "command": "GetValue",
            "variableName": "assignment.dimension",
            "widgetName": "cboType"
          },
          {
            "command": "GetValue",
            "variableName": "assignment.id",
            "widgetName": "cboAssign"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "ExtPresales.SalesTeamRetrieve(^assignment.id, {})",
                "variableName": "salesTeam"
              },
              {
                "command": "Set",
                "expression": "^salesTeam.path",
                "variableName": "assignment.dimensionValue"
              },
              {
                "command": "Set",
                "expression": "^salesTeam.name",
                "variableName": "assignment.name"
              }
            ],
            "command": "If",
            "expression": "^assignment.type == \"SalesTeam\""
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "ExtPresales.VendorRetrieve(^assignment.id)",
                "variableName": "vendor"
              },
              {
                "command": "Set",
                "expression": "^vendor.href",
                "variableName": "assignment.dimensionValue"
              },
              {
                "command": "Set",
                "expression": "Concat(^vendor.name,\" - \", ^vendor.id)",
                "variableName": "assignment.name"
              }
            ],
            "command": "ElseIf",
            "expression": "^assignment.type == \"Vendor\""
          },
          {
            "command": "Set",
            "expression": "^assignment",
            "variableName": "edition.assignTo"
          },
          {
            "command": "Execute",
            "expression": "ExtStrategicPlanMng.PlanGoalUpdate(^planId, ^mainGoalId, ^goalId, ^edition)"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "id",
            "type": "string"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "goalId",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          },
          {
            "name": "goalType",
            "type": "string"
          },
          {
            "name": "edition",
            "type": "ExtStrategicPlanMng.GoalEdition"
          },
          {
            "name": "assignment",
            "type": "ExtStrategicPlanMng.GoalAssignment"
          },
          {
            "name": "salesTeam",
            "type": "ExtPresales.SalesTeam"
          },
          {
            "name": "vendor",
            "type": "ExtPresales.SalesTeamVendor"
          }
        ]
      },
      "name": "main_submit"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "oldValue",
            "type": "any"
          },
          {
            "name": "newValue",
            "type": "any"
          }
        ],
        "statements": [
          {
            "children": [
              {
                "command": "Load",
                "expression": "Select(ExtPresales.SalesTeamList({}), [id, name])",
                "widgetName": "cboAssign"
              }
            ],
            "command": "If",
            "expression": "^newValue == \"SalesTeam\""
          },
          {
            "children": [
              {
                "command": "Load",
                "expression": "Select(ExtPresales.VendorList({}), [id, user.name])",
                "widgetName": "cboAssign"
              }
            ],
            "command": "ElseIf",
            "expression": "^newValue == \"Vendor\""
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "cboType_change"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "Load",
            "expression": "Select(GetAssignmentTypes(),[code,name])",
            "widgetName": "cboType"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "main_init"
    }
  ],
  "model": [
    {
      "name": "assignment",
      "required": false,
      "type": "ExtStrategicPlanMng.GoalAssignment"
    },
    {
      "name": "planId",
      "required": true,
      "type": "string"
    },
    {
      "name": "goalId",
      "required": true,
      "type": "string"
    },
    {
      "name": "mainGoalId",
      "required": true,
      "type": "string"
    },
    {
      "name": "goalType",
      "required": true,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "dataFormat": "KeyValueList",
            "label": "[[Type]]",
            "last": true,
            "mandatory": true,
            "name": "cboType",
            "size": 2,
            "widget": "ComboBox"
          },
          {
            "dataFormat": "KeyValueList",
            "label": "[[Name]]",
            "last": true,
            "mandatory": true,
            "name": "cboAssign",
            "size": 2,
            "widget": "ComboBox"
          }
        ],
        "layout": "form"
      }
    ],
    "layout": "responsive"
  },
  "routing": null,
  "unused": []
}