code: func GetPublicStateKind(j *engine.Job, traits task.Traits) PublicStateKind {
  	// TODO(vadimsh): Expose more states.
  	cronTick := j.CronTickTime()
  	switch {
  	case len(j.ActiveInvocations) != 0:
  		return PublicStateRunning
  	case !j.Enabled:
  		return PublicStateDisabled
  	case j.Paused:
  		return PublicStatePaused
  	case !cronTick.IsZero() && cronTick != schedule.DistantFuture:
  		return PublicStateScheduled
  	default:
  		return PublicStateWaiting
  	}
  }
docs: // GetPublicStateKind returns user-friendly state for a job.