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);
}
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;
}
Aggregations