basic workflow code for java