use of com.qcadoo.mes.states.service.StateChangeService in project mes by qcadoo.
the class StateChangeSamplesClientImpl method resumeStateChange.
@Override
public void resumeStateChange(final Entity entity, final Entity stateChangeEntity) {
entity.getDataDefinition().save(entity);
final StateChangeService stateChangeService = stateChangeServiceResolver.get(entity.getDataDefinition());
if (stateChangeService != null) {
final StateChangeEntityDescriber describer = stateChangeService.getChangeEntityDescriber();
final StateChangeContext stateChangeContext = stateChangeContextBuilder.build(describer, stateChangeEntity);
stateChangeContext.setStatus(StateChangeStatus.IN_PROGRESS);
stateChangeService.changeState(stateChangeContext);
checkResults(stateChangeContext);
}
}
use of com.qcadoo.mes.states.service.StateChangeService in project mes by qcadoo.
the class StateChangeSamplesClientImpl method changeState.
@Override
public Entity changeState(final Entity entity, final String targetState) {
Entity resultEntity = null;
final StateChangeService stateChangeService = stateChangeServiceResolver.get(entity.getDataDefinition());
if (stateChangeService == null) {
resultEntity = performDummyChange(entity, targetState);
} else {
resultEntity = performChange(stateChangeService, entity, targetState);
}
return resultEntity;
}
Aggregations