Imp. add conditions to publish event

Add conditions to publish event. These conditions retrieve from Spark Cloud variables.