{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "goal",
            "variableName": "goal"
          },
          {
            "command": "SetValue",
            "expression": "^goal",
            "widgetName": "renGoals"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ]
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "mainGoalId",
            "variableName": "mainGoalId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goal",
            "variableName": "goal"
          },
          {
            "buttons": "ok-cancel",
            "command": "Open",
            "expressionIcon": "\"edit.svg\"",
            "expressionStartModel": "{mainGoalId: ^mainGoalId, planId: ^planId, goal: ^goal}",
            "expressionTitle": "\"[[Edit]] \" + ^goal.name",
            "mode": "right-drawer",
            "size": "default",
            "uiComponentName": "CmpSpGoalEditor"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "^openedModel.goal",
                "variableName": "goal"
              },
              {
                "command": "SetValue",
                "expression": "^goal",
                "widgetName": "renGoals"
              },
              {
                "command": "WriteModel",
                "expression": "^goal",
                "modelVariableName": "goal"
              },
              {
                "command": "CloseCurrent"
              }
            ],
            "command": "OnOk",
            "variableNameOpenedModel": "openedModel"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "openedModel",
            "type": "any"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "mainGoalId",
            "type": "string"
          },
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          }
        ]
      },
      "name": "renGoals_handlerAction_edit"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "mainGoalId",
            "variableName": "maingoalId"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "goal",
            "variableName": "goal"
          },
          {
            "command": "ConfirmMessage",
            "expressionMessage": "\"[[ConfirmRemoveMainGoal]]\"",
            "expressionTitle": "\"[[ConfirmDelete]] \" + ^goal.name"
          },
          {
            "children": [
              {
                "command": "Execute",
                "expression": "ExtStrategicPlanMng.PlanGoalDelete(^planId, ^maingoalId, ^goal.id)"
              },
              {
                "command": "SendDataToParent",
                "expressionData": "{action: \"goalDeleted\"}"
              }
            ],
            "command": "OnYes"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "goal",
            "type": "ExtStrategicPlanMng.Goal"
          },
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "maingoalId",
            "type": "string"
          }
        ]
      },
      "name": "renGoals_handlerAction_delete"
    }
  ],
  "model": [
    {
      "name": "goal",
      "required": true,
      "type": "ExtStrategicPlanMng.Goal"
    },
    {
      "name": "planId",
      "required": true,
      "type": "string"
    },
    {
      "name": "mainGoalId",
      "required": true,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "actions": [
          {
            "icon": "edit.svg",
            "key": "edit",
            "text": "[[Edit]]"
          },
          {
            "icon": "remove.svg",
            "key": "delete",
            "text": "[[Remove]]"
          }
        ],
        "cssClass": "blz-padding-top blz-padding-right blz-padding-left blz-padding-bottom",
        "htmlTemplate": " <div class=\"detail\">\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[Name]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{name}}\n\t\t</div>\n\t</div>\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[FromTo]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{dateFormat fromDate format=\"DD/MM/YYYY\"}} - {{dateFormat toDate format=\"DD/MM/YYYY\"}}\n\t\t</div>\n\t</div> \n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[Description]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{description}}\n\t\t</div>\n\t</div>\t\t\t\t\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[GoalValue]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{formatCurrency goalValue}}\n\t\t</div>\n\t</div>\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[RemainingValue]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t \n\t\t</div>\n\t</div>\t\t\t\t\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[Amount]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{scope.name}}\n\t\t</div>\n\t</div>\n\t<div class=\"detail-item\">\n\t\t<div class=\"title\">\n\t\t\t[[TypeAmount]]\n\t\t</div>\n\t\t<div class=\"description\">\n\t\t\t{{dimensionDate}}\n\t\t</div>\n\t</div> \n\t \n</div>",
        "name": "renGoals",
        "title": "[[Blank]]",
        "typeName": "ExtStrategicPlanMng.Goal",
        "widget": "HtmlRenderer"
      }
    ],
    "cssClass": "blz-padding-bottom",
    "layout": "responsive"
  },
  "routing": null,
  "unused": []
}