flow: more code generation work done.

Change-Id: Ibc71fd17599b7ece6641ecabd6f81011c82ab6a9