To enforce linear constraints on Petri nets that are partially controllable and observable, this work proposes an approach based on constraint transformation. First, a state-space equation of a Petri net control system based on event feedback is obtained by expressing a control action as a matrix, and the optimal control policy is designed. However, this policy needs to solve a nonlinear program on line. Second, pre-transition-gain-transformation is proposed to equivalently transform a constraint into a disjunction of new ones for an uncontrollable transition, and, similarly, post-transition-gain-transformation to transform a constraint into a disjunction of new ones for an unobservable transition. An algorithm is then given to transform a constraint into a disjunction of admissible ones, and, consequently, an efficient policy, which may not be optimal, can be designed. Third, in order to guarantee that the policy be both efficient and optimal, a dynamic linear constraint is introduced. Further, observing-transformation is proposed to simplify a dynamic constraint for an unobservable transition, and an algorithm is given to equivalently transform a class of linear constraints into admissible dynamic ones. As a result, an optimal controller requiring little online computation can be designed accordingly for some class of Petri nets. Finally, a maze system is used to illustrate the theoretical results.