Comments:Pre-Condition: Job

Run if Any Ancestor Job Failed and the Originating Request Was a Trigger

import com.urbancode.anthill3.domain.buildlife.BuildLife; import com.urbancode.anthill3.domain.buildrequest.BuildRequest; import com.urbancode.logic.Criteria; import com.urbancode.anthill3.domain.buildrequest.RequestSourceEnum;

public class TriggeredJobStatus extends Criteria {

 public TriggeredJobStatus() {
   super();
 }
 public boolean matches(Object obj) {
   BuildLife bl = BuildLifeLookup.getCurrent();
   BuildRequest request = bl.getOriginatingRequest();
   if (request.getRequestSource().equals(RequestSourceEnum.EVENT) || request.getRequestSource().equals(RequestSourceEnum.SCHEDULED) || request.getRequestSource().equals(RequestSourceEnum.REPOSITORY)) {
     return true;
   }
   else {
     return false;
   }
 }

}

return Logic.and(new TriggeredJobStatus(), JobStatus.anyAre(JobStatusEnum.FAILED));

Jon Neel 05-Oct-2012 11:56 EDT

TBD