interface IFunctionCallReturnLocal { in void doIt(); out void done(); out void skip(); behaviour { enum Toggle {Ping, Pong}; Toggle state = Toggle.Ping; bool shouldWeDoIt() { bool result = false; //result = (state == Toggle.Ping); if (state == Toggle.Ping) { result = true; return result; } else { return false; } return result; } on doIt: { bool localVariable = shouldWeDoIt(); if (localVariable) { done; state = Toggle.Pong; } else { skip; state = Toggle.Ping; } } } }