This study investigates the potential application of Stateflow (SF) to design an energy management strategy (EMS) for a renewable-based hybrid energy system (HES). The SF is an extended finite state machine; it provides a platform to design, model, and execute complex event-driven systems using an interactive graphical environment. The HES comprises photovoltaics (PV), energy storage units (ESU) and a diesel generator (Gen), integrated with the power grid that experiences a regular load shedding condition (scheduled power outages). The EMS optimizes the energy production and utilization during both modes of HES operation, i.e., grid-connected mode and the islanded mode. For islanded operation mode, a resilient power delivery is ensured when the system is subjected to intermittent renewable supply and grid vulnerability. The contributions of this paper are twofold: first is to propose an integrated framework of HES to address the problem of load shedding, and second is to design and implement a resilient EMS in the SF environment. The validation of the proposed EMS demonstrates its feasibility to serve the load for various operating scenarios. The latter include operations under seasonal variation, abnormal weather conditions, and different load shedding patterns. The simulation results reveal that the proposed EMS not only ensures uninterrupted power supply during load shedding but also reduces grid burden by maximizing the use of PV energy. In addition, the SF-based adopted methodology is envisaged to be a useful alternative to the popular design method using the conventional software tools, particularly for event-driven systems.