1. A method for creating a distributed application flow from a set of rules, wherein the method comprises: creating a control-flow graph for each rule and creating one or more dependency links between two or more rules; partitioning a resulting graph, wherein the resulting graph comprises one or more control-flow graphs and one or more dependency links, into one or more operators by determining an optimal set of one or more cuts through the resulting graph such that a cost function is minimized; and generating stream processing flow code from the partitioned graph.