method2testcases
stringlengths
118
6.63k
### Question: OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PR...
### Question: CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getF...
### Question: DeviationsReportCriteria { public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } private DeviationsReportCriteria(final Interval searchInterval); static Date...
### Question: CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.com...
### Question: OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToFi...
### Question: DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { se...
### Question: DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields...
### Question: WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(...
### Question: SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter....
### Question: DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService...
### Question: DeliveredProductDetailsHooks { public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdat...
### Question: WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer produc...
### Question: CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.a...
### Question: CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addE...
### Question: DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override void fillColumnsForDeliveries(final...
### Question: WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_...
### Question: DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } @Override void fillColumnsForDeliveries(final String ...
### Question: DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisable(); ...
### Question: DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisab...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity getDelivered...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId...
### Question: WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttri...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Over...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Lon...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new A...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(fin...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrder...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getO...
### Question: WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttr...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrder...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } @Override Entity getDelivery(final Long deliveryId); @Override...
### Question: DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override Entity getDelivery(final Long deliveryId); @Override Enti...
### Question: OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return is...
### Question: OrderHooksCNFM { public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.g...
### Question: WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final Wor...
### Question: OrderMaterialCostsEntityBuilderImpl implements OrderMaterialCostsEntityBuilder { @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConsta...
### Question: ColumnExtensionServiceImpl implements ColumnExtensionService { public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER...
### Question: ColumnExtensionServiceImpl implements ColumnExtensionService { public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAtt...
### Question: ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } Map<Integer, Map<String, String>> getColumnsAttributesFromXML(fina...
### Question: QualityControlService { public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (cont...
### Question: QualityControlService { public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QU...
### Question: QualityControlService { public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponen...
### Question: QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDef...
### Question: QualityControlService { public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); da...
### Question: QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity =...
### Question: QualityControlService { public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldCo...
### Question: QualityControlService { public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); } void setTechnology(final ViewDefinitionState view); void checkIfCommentIsRequiredBased...
### Question: QualityControlService { public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Cont...
### Question: QualityControlService { public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity....
### Question: WorkPlanHooks { public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); } void onCreate(final DataDefinition workPlanDD, final Entity workPlan); void onCopy(final DataDefinition workPlanDD, final Entity workPlan); }### Answer: @Test public void should...
### Question: LineChangeoverNormsDetailsHooks { public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); } final void onBeforeRender(final ViewDefinitionState view); void setLineChangeoverNormsName(final ViewD...
### Question: DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocum...
### Question: ProductsFamiliesListeners { public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); } final void generateHierarchyTree(final ViewDefinitionState view, final ComponentState state, final String[] args); final v...
### Question: BasicController { @RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("c...
### Question: ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldCompon...
### Question: ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue...
### Question: WorkPlansListView { public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, final GridComponent workPlansGrid); static WorkPlansListView from(final ViewDefinitionState view); void setUpD...
### Question: UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringFie...
### Question: ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityTy...
### Question: ProductHooks { public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); } void generateNodeNumber(final DataDefinition productDD, final Entity product); void updateNodeNumber(final DataDefinition...
### Question: ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr ...
### Question: ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean...
### Question: WorkPlansListView { public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem ...
### Question: CompanyService { public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean isCompanyOwner(final Entity company); void disabl...
### Question: CompanyService { @Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean is...
### Question: Shift { public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRan...
### Question: WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); boolean isEmpty(); boolean contains(final LocalTime time); Optional<TimeRange> findRangeFor(final LocalTime time); Set<TimeRange> g...
### Question: ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }### Answer: @Test public vo...
### Question: ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG...
### Question: ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } Entity find(final SearchProjection projection, final SearchCriterion criteria, final Searc...
### Question: ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.ge...
### Question: ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true...
### Question: ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrde...
### Question: TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentI...
### Question: OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(Ope...
### Question: OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referen...
### Question: OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTI...
### Question: ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_...
### Question: OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem cre...
### Question: OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }### A...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previous...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGE...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderT...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderT...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOU...
### Question: ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT...
### Question: LineChangeoverNormsForOrderDetailsListeners { public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); } final v...
### Question: LineChangeoverNormsForOrderDetailsListeners { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION);...
### Question: OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); paramete...
### Question: OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChange...
### Question: LineChangeoverNormsForOrderDetailsViewHooks { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); } final void fillOrderForms(final ViewDefinitionState vi...
### Question: TechnologyOperationComponentHooksTS { public void copySubstractingFieldFromLowerInstance(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { if (!shouldCopyFromLowerInstance(technologyOperationComponent)) { return; } Entity operation = technologyOperationCompo...
### Question: MasterOrderHooks { protected void setExternalSynchronizedField(final Entity masterOrder) { masterOrder.setField(MasterOrderFields.EXTERNAL_SYNCHRONIZED, true); } void onCreate(final DataDefinition dataDefinition, final Entity masterOrder); void onSave(final DataDefinition dataDefinition, final Entity mas...
### Question: MasterOrderProductDetailsHooks { public void fillUnitField(final ViewDefinitionState view) { LookupComponent productField = (LookupComponent) view.getComponentByReference(MasterOrderProductFields.PRODUCT); Entity product = productField.getEntity(); String unit = null; if (product != null) { unit = product...
### Question: MasterOrderProductDetailsHooks { public void showErrorWhenCumulatedQuantity(final ViewDefinitionState view) { FormComponent masterOrderProductForm = (FormComponent) view.getComponentByReference(L_FORM); Entity masterOrderProduct = masterOrderProductForm.getPersistedEntityWithIncludedFormValues(); if ((mas...
### Question: OrderValidatorsMO { public boolean checkProductAndTechnology(final DataDefinition orderDD, final Entity order) { Entity masterOrder = order.getBelongsToField(MASTER_ORDER); if (masterOrder == null || masterOrder.getHasManyField(MasterOrderFields.MASTER_ORDER_PRODUCTS).isEmpty()) { return true; } return ch...
### Question: OrderValidatorsMO { public boolean checkCompanyAndDeadline(final DataDefinition orderDD, final Entity order) { boolean isValid = true; Entity masterOrder = order.getBelongsToField(MASTER_ORDER); if (masterOrder == null) { return isValid; } if (!checkIfBelongToFieldIsTheSame(order, masterOrder, COMPANY)) {...
### Question: OrderValidatorsMO { public boolean checkOrderNumber(final DataDefinition orderDD, final Entity order) { Entity masterOrder = order.getBelongsToField(MASTER_ORDER); if (masterOrder == null) { return true; } if (!masterOrder.getBooleanField(ADD_MASTER_PREFIX_TO_NUMBER)) { return true; } String masterOrderNu...
### Question: OperationalTaskDetailsListenersOTFOOverrideUtil { public void setOperationalTaskNameDescriptionAndProductionLineForSubcontracted(final ViewDefinitionState view) { LookupComponent orderLookup = (LookupComponent) view.getComponentByReference(OperationalTaskFieldsOTFO.ORDER); LookupComponent technologyOperat...