We consider an optimal control problem for piecewise deterministic Markov processes (PDMPs) on a bounded state space. The control problem under study is very general: a pair of controls acts continuously on the deterministic flow and on the two transition measures (in the interior and from the boundary of the domain) describing the jump dynamics of the process. For this class of control problems, the value function can be characterized as the unique viscosity solution to the corresponding fully-nonlinear Hamilton-Jacobi-Bellman equation with a non-local type boundary condition.By means of the recent control randomization method, we are able to provide a probabilistic representation for the value function in terms of a constrained backward stochastic differential equation (BSDE), known as nonlinear Feynman-Kac formula. This result considerably extends the existing literature, where only the case with no jumps from the boundary is considered. The additional boundary jump mechanism is described in terms of a non quasi-left-continuous random measure and induces predictable jumps in the PDMP's dynamics. The existence and uniqueness results for BSDEs driven by such a random measure are non trivial, even in the unconstrained case, as emphasized in the recent work [2].Keywords: Backward stochastic differential equations, optimal control problems, piecewise deterministic Markov processes, non quasi-left-continuous random measure, randomization of controls.MSC 2010: 93E20, 60H10, 60J25.