public boolean isEntityTypeSame(final OperationProductComponentEntityType operationProductComponentEntityType) { return operationProductComponentEntityType.equals(getEntityType()); }
public boolean isEntityTypeSame(final String operationProductComponentModelName) { return isEntityTypeSame(OperationProductComponentEntityType.parseString(operationProductComponentModelName)); }
public Entity fromOperationProductComponentHolder(final OperationProductComponentHolder operationProductComponentHolder) { String modelName = operationProductComponentHolder.getEntityType().getStringValue(); ProductionCountingQuantityRole role = null; String typeOfMaterial = operationProductComponentHolder.getProductMaterialType().getStringValue(); if (TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT.equals(modelName)) { role = ProductionCountingQuantityRole.USED; } else if (TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT.equals(modelName)) { role = ProductionCountingQuantityRole.PRODUCED; } else { throw new IllegalArgumentException(String.format("Unsupported operation component type: %s", modelName)); } Entity product = operationProductComponentHolder.getProduct(); return fromProduct(product, role, typeOfMaterial); }
&& OperationProductComponentEntityType.OPERATION_PRODUCT_IN_COMPONENT.equals(componentHolder.getEntityType()) && (componentHolder.getOperationProductComponentId() != null)) { Entity opic = dataDefinitionService
public OperationProductComponentWithQuantityContainer getAllWithSameEntityType(final String operationProductComponentModelName) { return getAllWithSameEntityType(OperationProductComponentEntityType.parseString(operationProductComponentModelName)); }
public OperationProductComponentHolder(final Entity operationProductComponent) { Entity product = operationProductComponent.getBelongsToField(L_PRODUCT); Entity technologyOperationComponent = operationProductComponent.getBelongsToField(L_OPERATION_COMPONENT); OperationProductComponentEntityType entityType = OperationProductComponentEntityType .parseString(operationProductComponent.getDataDefinition().getName()); this.productId = product.getId(); this.technologyOperationComponentId = technologyOperationComponent.getId(); this.productDD = product.getDataDefinition(); this.technologyOperationComponentDD = technologyOperationComponent.getDataDefinition(); this.entityType = entityType; this.productMaterialType = ProductMaterialType.NONE; this.productionCountingQuantityId = null; this.operationProductComponentId = operationProductComponent.getId(); }