Search in sources :

Example 1 with TechnologyState

use of com.qcadoo.mes.technologies.states.constants.TechnologyState in project mes by qcadoo.

the class TechnologyTreeValidators method isTechnologyIsAlreadyAccepted.

private boolean isTechnologyIsAlreadyAccepted(final Entity technology, final Entity existingTechnology) {
    if (technology == null || existingTechnology == null) {
        return false;
    }
    TechnologyState technologyState = TechnologyState.parseString(technology.getStringField(STATE));
    TechnologyState existingTechnologyState = TechnologyState.parseString(existingTechnology.getStringField(STATE));
    return TechnologyState.ACCEPTED.equals(technologyState) && technologyState.equals(existingTechnologyState);
}
Also used : TechnologyState(com.qcadoo.mes.technologies.states.constants.TechnologyState)

Example 2 with TechnologyState

use of com.qcadoo.mes.technologies.states.constants.TechnologyState in project mes by qcadoo.

the class TechnologyDetailsHooks method getTechnologyState.

private TechnologyState getTechnologyState(final ViewDefinitionState view) {
    final FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    final Entity technology = form.getEntity();
    TechnologyState state = TechnologyState.DRAFT;
    if (Objects.nonNull(technology)) {
        state = TechnologyState.parseString(technology.getStringField(TechnologyFields.STATE));
    }
    return state;
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity) TechnologyState(com.qcadoo.mes.technologies.states.constants.TechnologyState)

Aggregations

TechnologyState (com.qcadoo.mes.technologies.states.constants.TechnologyState)2 Entity (com.qcadoo.model.api.Entity)1 FormComponent (com.qcadoo.view.api.components.FormComponent)1