Search in sources :

Example 1 with CIEventCauseType

use of com.hp.octane.integrations.dto.causes.CIEventCauseType in project octane-gitlab-service by MicroFocus.

the class EventListener method getCauses.

private List<CIEventCause> getCauses(JSONObject event, boolean isScmNull) {
    List<CIEventCause> causes = new ArrayList<>();
    CIEventCauseType type = convertCiEventCauseType(event, isScmNull);
    CIEventCause rootCause = dtoFactory.newDTO(CIEventCause.class);
    rootCause.setType(type);
    rootCause.setUser(type == CIEventCauseType.USER ? getUser(event) : null);
    if (isDeleteBranchEvent(event) || isPipelineEvent(event)) {
        causes.add(rootCause);
    } else {
        CIEventCause cause = dtoFactory.newDTO(CIEventCause.class);
        cause.setType(CIEventCauseType.UPSTREAM);
        // /
        cause.setProject(getProjectCiId(event));
        cause.setBuildCiId(getRootId(event).toString());
        cause.getCauses().add(rootCause);
        causes.add(cause);
    }
    return causes;
}
Also used : CIEventCause(com.hp.octane.integrations.dto.causes.CIEventCause) CIEventCauseType(com.hp.octane.integrations.dto.causes.CIEventCauseType)

Aggregations

CIEventCause (com.hp.octane.integrations.dto.causes.CIEventCause)1 CIEventCauseType (com.hp.octane.integrations.dto.causes.CIEventCauseType)1