{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goalType",
            "variableName": "goalType"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goalId",
            "variableName": "goalId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "mainGoalId",
            "variableName": "mainGoalId"
          },
          {
            "command": "Set",
            "expression": "{fields:[\"Scope\",\"Goals\"]}",
            "variableName": "args"
          },
          {
            "command": "Switch",
            "expression": "^goalType"
          },
          {
            "children": [
              {
                "command": "Hide",
                "widgetName": "goalAssigmentResponsive"
              },
              {
                "command": "Hide",
                "widgetName": "goalPartialResponsive"
              },
              {
                "command": "Hide",
                "widgetName": "goalSupportMeasureResponsive"
              },
              {
                "command": "Set",
                "expression": "ExtStrategicPlanMng.PlanMainGoalRetrieve(^planId, ^goalId, ^args)",
                "variableName": "mainGoal"
              },
              {
                "command": "OpenInContainer",
                "expressionIcon": "\"\"",
                "expressionStartModel": "{goal: ^mainGoal, planId: ^planId}",
                "expressionTitle": "\"\"",
                "uiComponentName": "CmpSpMainGoalDetails",
                "widgetNameContainer": "goalDetailContainer"
              },
              {
                "command": "SetValue",
                "expression": "getMainGoalHeader(^mainGoal)",
                "widgetName": "renGoalTitle"
              }
            ],
            "command": "Case",
            "expression": "\"mainGoal\""
          },
          {
            "children": [
              {
                "command": "Show",
                "widgetName": "goalAssigmentsContainer"
              },
              {
                "command": "Set",
                "expression": "ExtStrategicPlanMng.PlanGoalRetrieve(^planId, ^mainGoalId, ^goalId)",
                "variableName": "goal"
              },
              {
                "command": "OpenInContainer",
                "expressionIcon": "\"\"",
                "expressionStartModel": "{goal: ^goal, planId: ^planId, mainGoalId: ^mainGoalId, goalId: ^goalId}",
                "expressionTitle": "\"\"",
                "uiComponentName": "CmpSpGoalDetails",
                "widgetNameContainer": "goalDetailContainer"
              },
              {
                "command": "SetValue",
                "expression": "getGoalHeader(^goal)",
                "widgetName": "renGoalTitle"
              }
            ],
            "command": "Case",
            "expression": "\"goal\""
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "goalId",
            "type": "string"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "goalType",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          },
          {
            "name": "mainGoal",
            "type": "ExtStrategicPlanMng.MainGoal"
          },
          {
            "name": "args",
            "type": "ExtStrategicPlanMng.ArgsPlanMainGoalRetrieve"
          },
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ]
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "data",
            "type": "any"
          }
        ],
        "statements": [
          {
            "children": [
              {
                "command": "SendDataToParent",
                "expressionData": "^data"
              }
            ],
            "command": "If",
            "expression": "Contains(^data.action, \"mainGoalDeleted\") || Contains(^data.action, \"goalDeleted\")"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "main_receiveData"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "getData()",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpPsGoalFilterCrud",
            "widgetNameContainer": "goalFiltersContainer"
          }
        ],
        "variables": [
          {
            "name": "goalId",
            "type": "string"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "goalType",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          }
        ]
      },
      "name": "goalFiltersContainer_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "getData()",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpSfGoalsCrud",
            "widgetNameContainer": "goalsContainer"
          }
        ],
        "variables": [
          {
            "name": "goalId",
            "type": "string"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "goalType",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          }
        ]
      },
      "name": "goalsContainer_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "getData()",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpSfGoalPartialCrud",
            "widgetName": "goalAssigmentResponsive",
            "widgetNameContainer": "goalPartialContainer"
          }
        ],
        "variables": []
      },
      "name": "goalPartialContainer_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "getData()",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpSfGoalMeasureCrud",
            "widgetNameContainer": "goalSupportMeasureContainer"
          }
        ],
        "variables": []
      },
      "name": "goalSupportMeasureContainer_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "getData()",
            "expressionTitle": "\"\"",
            "uiComponentName": "CmpSfGoalAssigmentsCrud",
            "widgetNameContainer": "goalAssigmentsContainer"
          }
        ],
        "variables": []
      },
      "name": "goalAssigmentsContainer_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "goalId",
            "variableName": "goalId",
            "widgetName": "goalAssigmentResponsive"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId",
            "widgetName": "goalAssigmentResponsive"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goalType",
            "variableName": "goalType",
            "widgetName": "goalAssigmentResponsive"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "mainGoalId",
            "variableName": "mainGoalId",
            "widgetName": "goalAssigmentResponsive"
          },
          {
            "command": "Set",
            "expression": "{planId: ^planId, goalType: ^goalType, goalId: ^goalId, mainGoalId: ^mainGoalId}",
            "variableName": "data",
            "widgetName": "goalAssigmentResponsive"
          },
          {
            "command": "Return",
            "expression": "^data",
            "widgetName": "goalAssigmentResponsive"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "goalId",
            "type": "string"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "goalType",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          },
          {
            "name": "data",
            "type": "any"
          }
        ]
      },
      "name": "getData"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "mainGoal",
            "type": "ExtStrategicPlanMng.MainGoal"
          }
        ],
        "statements": [
          {
            "command": "Set",
            "expression": "0",
            "variableName": "remainingValue"
          },
          {
            "command": "Set",
            "expression": "0",
            "variableName": "assignedValue"
          },
          {
            "command": "Set",
            "expression": "{name: ^mainGoal.name, goalValue: ^mainGoal.goalValue}",
            "variableName": "data"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "command": "Set",
                    "expression": "^remainingValue + Nvl(^goal.goalValue, 0)",
                    "variableName": "remainingValue"
                  }
                ],
                "command": "ForEach",
                "expressionList": "^mainGoal.goals",
                "variableNameItem": "goal"
              }
            ],
            "command": "If",
            "expression": "IsNotNull(^mainGoal.goals)"
          },
          {
            "command": "Set",
            "expression": "^mainGoal.goalValue - ^remainingValue",
            "variableName": "assignedValue"
          },
          {
            "command": "Set",
            "expression": "^mainGoal.goalValue - ^remainingValue",
            "variableName": "data.remainingValue"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "\"red\"",
                "variableName": "data.remainingClass"
              }
            ],
            "command": "If",
            "expression": "data.remainingValue > 0"
          },
          {
            "command": "Set",
            "expression": "0",
            "variableName": "data.assignedValue"
          },
          {
            "command": "Return",
            "expression": "^data"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "data",
            "type": "any"
          },
          {
            "name": "assignedValue",
            "type": "decimal"
          },
          {
            "name": "remainingValue",
            "type": "decimal"
          },
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ]
      },
      "name": "getMainGoalHeader"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ],
        "statements": [
          {
            "command": "Set",
            "expression": "0",
            "variableName": "remainingValue"
          },
          {
            "command": "Set",
            "expression": "0",
            "variableName": "assignedValue"
          },
          {
            "command": "Set",
            "expression": "{name: ^goal.name, goalValue: ^goal.goalValue}",
            "variableName": "data"
          },
          {
            "children": [
              {
                "children": [
                  {
                    "command": "Set",
                    "expression": "^remainingValue + Nvl(^childGoal.goalValue, 0)",
                    "variableName": "remainingValue"
                  }
                ],
                "command": "ForEach",
                "expressionList": "^goal.goals",
                "variableNameItem": "childGoal"
              }
            ],
            "command": "If",
            "expression": "IsNotNull(^goal.goals)"
          },
          {
            "command": "Set",
            "expression": "^goal.goalValue - ^remainingValue",
            "variableName": "assignedValue"
          },
          {
            "command": "Set",
            "expression": "^remainingValue",
            "variableName": "data.remainingValue"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "\"red\"",
                "variableName": "data.remainingClass"
              }
            ],
            "command": "If",
            "expression": "data.remainingValue > 0"
          },
          {
            "command": "Set",
            "expression": "^assignedValue",
            "variableName": "data.assignedValue"
          },
          {
            "command": "Return",
            "expression": "^data"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "data",
            "type": "any"
          },
          {
            "name": "assignedValue",
            "type": "decimal"
          },
          {
            "name": "remainingValue",
            "type": "decimal"
          },
          {
            "name": "childGoal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ]
      },
      "name": "getGoalHeader"
    }
  ],
  "model": [
    {
      "name": "goalId",
      "required": true,
      "type": "string"
    },
    {
      "name": "planId",
      "required": true,
      "type": "string"
    },
    {
      "name": "goalType",
      "required": true,
      "type": "string"
    },
    {
      "name": "mainGoalId",
      "required": false,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "cssClass": "blz-area-default blz-padding-top blz-padding-right blz-padding-left blz-padding-bottom blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius",
            "htmlTemplate": "<div style=\"display:flex\">\n\t<div class=\"blz-responsive-col blz-responsive-col-6\" >\n\t\t<div class=\"detail\">\n\t\t\t<div class=\"detail-item\">\n\t\t\t\t<div class=\"title\">\n\t\t\t\t\t[[Name]]\n\t\t\t\t</div>\n\t\t\t\t<div class=\"description\">\n\t\t\t\t\t{{name}}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"detail-item\">\n\t\t\t\t<div class=\"title\">\n\t\t\t\t\t[[GoalValue]]\n\t\t\t\t</div>\n\t\t\t\t<div class=\"description\">\n\t\t\t\t\t{{formatCurrency goalValue}}\n\t\t\t\t</div>\n\t\t\t</div>\t \n\t\t</div>\n\t</div>\n\t<div class=\"blz-responsive-col blz-responsive-col-6\">\n\t\t<div class=\"detail\">\n\t\t\t<div class=\"detail-item\">\n\t\t\t\t<div class=\"title\">\n\t\t\t\t\t[[RemainingValue]]\n\t\t\t\t</div>\n\t\t\t\t<div class=\"description\" style=\"color:{{remainingClass}};\">\t\t\t\t\t \n                  \t{{formatCurrency remainingValue}}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"detail-item\">\n\t\t\t\t<div class=\"title\">\n\t\t\t\t\t[[AccumulatedValue]]\n\t\t\t\t</div>\n\t\t\t\t<div class=\"description\" style=\"color:{{assignedValueColor}};\">\n\t\t\t\t\t{{formatCurrency assignedValue}}\n\t\t\t\t</div>\n\t\t\t</div>\t \n\t\t</div>\n\t</div>\n </div>",
            "name": "renGoalTitle",
            "typeName": "ExtStrategicPlanMng.MainGoal",
            "widget": "HtmlRenderer"
          }
        ],
        "cssClass": "blz-padding-bottom",
        "layout": "responsive"
      },
      {
        "children": [
          {
            "children": [
              {
                "children": [
                  {
                    "name": "goalDetailContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "title": "[[Details]]"
              },
              {
                "children": [
                  {
                    "name": "goalsContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "title": "[[Goals]]"
              },
              {
                "children": [
                  {
                    "name": "goalFiltersContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "title": "[[Filters]]"
              },
              {
                "children": [
                  {
                    "name": "goalAssigmentsContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "name": "goalAssigmentResponsive",
                "title": "[[Assignments]]"
              },
              {
                "children": [
                  {
                    "name": "goalPartialContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "name": "goalPartialResponsive",
                "title": "[[PartialPeriod]]"
              },
              {
                "children": [
                  {
                    "name": "goalSupportMeasureContainer",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "responsive",
                "name": "goalSupportMeasureResponsive",
                "title": "[[SupportMeasure]]"
              }
            ],
            "cssClass": "blz-area-default blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius blz-cast-shadow",
            "layout": "tabs"
          }
        ],
        "layout": "responsive"
      }
    ],
    "cssClass": "blz-padding-right blz-padding-left blz-padding-bottom",
    "layout": "responsive"
  },
  "routing": null,
  "unused": []
}