Optimizing Business Processes for Internet of Things