Checking if task instance has required leaving transition