Blockchain provides an immutable distributed ledger for storing transactions. One of the challenges of blockchain is the particular processing of dynamic queries due to accumulating costs. Complex Event Processing (CEP) provides efficient and effective support for this in a way, however, that is difficult to integrate with blockchain. This paper addresses the research challenges of integrating blockchain with CEP. More specifically, we envision an effective development environment in which (i) event-driven smart contracts are modeled in a graphical way, which are, in turn, (ii) automatically transformed into complementary code that is deployed in both a CEP engine and a blockchain network, and then (iii) executed on off-chain CEP applications which, connected to different data sources and sinks, automatically invoke smart contracts when event pattern conditions are met. We follow a classic systems engineering approach for defining the concepts of our system, called CEPchain, which addresses the described requirements. CEPchain was evaluated using a real-world case study for vaccine delivery, which requires an unbroken cold chain. The results demonstrate that our approach can be applied without requiring experts on event processing and smart contract languages. Our contribution simplifies the design of integrated CEP and blockchain functionality by hiding implementation details and supporting efficient deployment.