Package net.pricefx.domain
Class Pricelist
Object
DomainObject
PersistedObject
PartitionedObject
AbstractCalculable
CalculableObject
MatrixableCalculableObject
Pricelist
- All Implemented Interfaces:
APIModifiable,Approvable,Calculable,HasCalculableObjectItems,JobNameProvider,JobSettingsProvider,NamedChangeTracker,Persistable,TreeStructuredObject,UserGroupRestrictedObject
@Entity
public class Pricelist
extends MatrixableCalculableObject
implements TreeStructuredObject, UserGroupRestrictedObject, Approvable, APIModifiable, NamedChangeTracker, JobSettingsProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumABORT is used as defaultstatic enumNested classes/interfaces inherited from class MatrixableCalculableObject
MatrixableCalculableObject.ListTypeNested classes/interfaces inherited from class PersistedObject
PersistedObject.BatchDelete, PersistedObject.BulkloadFilterCheckCallback, PersistedObject.ComputedFieldMapping, PersistedObject.ComputedFields, PersistedObject.ImportManagerEnabled, PersistedObject.PersistedObjectMeta, PersistedObject.VirtualField, PersistedObject.VirtualFieldMapping, PersistedObject.VirtualFields, PersistedObject.VirtualSearchFields, PersistedObject.VirtualSortFields -
Field Summary
Fields inherited from class AbstractCalculable
FIELD_CALCDATE, FIELD_CALCMESSAGES, FIELD_CALCSTARTDATE, FIELD_STATUS, MAX_CALCULATION_MESSAGE_THRESHOLDFields inherited from class PartitionedObject
FIELD_PARTITION, FIELD_PARTITIONID, PARTITION_FILTER_NAME, PARTITION_FILTER_PARAMFields inherited from class PersistedObject
FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ID, FIELD_ISDELETED, FIELD_LASTUPDATEBY, FIELD_LASTUPDATEDATE, FIELD_VERSIONFields inherited from class DomainObject
DEFAULT_MAX_PACKET_SIZEFields inherited from interface Approvable
FIELD_WFLASTEXECUTEDBYNAMEFields inherited from interface UserGroupRestrictedObject
FIELD_USERGROUPEDIT, FIELD_USERGROUPVIEWDETAILS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanOverride this method to restrict the possibility to delete an object of this type.booleancanEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String, Object> fieldsToEdit) Override this method to do edit-ability checks based on request details and object data (or related object data) and new data from request In case of a false return value a validation error should be added.booleanOverride to define if an object instance should be really deleted (vs just marked as deleted) Default: soft-deleteprotected voidfillSubmitter(User submitter) protected voidfillWfLastExecutedByName(User executedByName) getAgentOption1(PersistedObjectService objService, JobStatusTracker jst, int runNumber) List<?> A list of attachments to attach into approval-required emailsJobStatusTracker.TrackerTypebooleanClass<? extends ElementAttributeMeta> Class<? extends AbstractPricelistItem> static Class<? extends AbstractPricelistItem> getItemClassS(MatrixableCalculableObject.ListType type) static StringgetJstId()MatrixableCalculableObject.ListTypePricelistConfigurationMatrixableCalculableObject.ListTypeintgetShotgunThreshold(PersistedObjectService objService, JobStatusTracker jst) getUniqueNamePrefix(PersistedObjectService objService) Workflow.WorkflowStatusbooleanisMatrix()booleanvoiditemsStateChanged(PersistedObjectService objService) intjobSize(PersistedObjectService objectService, JobStatusTracker jst, int runNumber) Called from the workflow engine.voidonApproved(User approver) Called from the workflow engine, one the workflow is completedvoidonApproved(User approver, PersistedObjectService objectService) Called from the workflow engine, one the workflow is completedCalled from the workflow engine.voidonNoApprovalRequired(User approver, WorkflowDTO workflowDTO, ApprovalActionsService approvalActionsService) Called in case no approval is required (but the approvable was submittedbooleanonPreProcessing(Map<String, Object> values, LocalDateTime targetDate) Invoked before processing starts.voidonSaveOrUpdate(PersistedObjectService objService) Default does nothing.onWithdraw(User withdrawer) Called from the workflow engine.voidInits the loaded Approvable.voidresetWorkflow(PersistedObjectService objService) voidsetApprovalDate(LocalDateTime approvalDate) voidsetApprovalState(ApprovalState approvalState) voidsetApprovedByName(String approvedByName) voidsetConfiguration(String configuration) voidsetCreatedByName(String createdByName) voidsetDeniedByName(String deniedByName) voidsetDescription(String description) voidsetErrorMode(Pricelist.PricelistErrorModeType errorMode) voidsetExpiryDate(LocalDateTime expiryDate) voidsetExportDate(LocalDateTime exportDate) voidsetHasCriticalAlert(Boolean hasCriticalAlert) voidsetHeaderType(PriceListTypeOnly priceListType) voidsetIntegrationStatus(String integrationStatus) voidsetItemApprovalReason(Map<String, String> reasons) Sets item level reason texts.voidvoidsetLastUpdateByName(String lastUpdateByName) voidvoidsetPreviousPricelistId(Long previousPricelistId) voidsetPricelistConfiguration(PricelistConfiguration config) voidsetPricelistId(Long id) voidsetPricelistPricegridTypeUniqueName(String pricelistPricegridTypeUniqueName) voidsetPricelistType(MatrixableCalculableObject.ListType pricelistType) voidsetProcessingMode(Pricelist.ProcessingMode processingMode) voidsetSubmitDate(LocalDateTime submitDate) voidsetUpdateDate(LocalDateTime updateDate) voidsetUpdatedBy(Long updateBy) voidsetUserGroupEdit(String userGroup) voidsetUserGroupViewDetails(String userGroup) voidsetWorkflowStatus(Workflow.WorkflowStatus workflowStatus) Possible workflowStatus values: DRAFT, SUBMITTED, DENIED, APPROVED, NO_APPROVAL_REQUIRED, WITHDRAWN, INVALIDATEDtypeName()Typically the lowercased class name of the approvable object (e.g.voidupdatePricelistHeader(PersistedObjectService objService) booleanvalidate(ValidationVisitor validationVisitor, PersistedObjectService objService) Override to implement per-object validation rulesMethods inherited from class MatrixableCalculableObject
anyToRecalculationMethods inherited from class CalculableObject
getEffectiveTargetDate, getKeepManualOverrides, getNumberOfItems, getWriteOnlyChangedItems, setKeepManualOverrides, setNumberOfItems, setWriteOnlyChangedItemsMethods inherited from class AbstractCalculable
calculationDate, calculationStartDate, getCalculationConcurrencyKey, getCalculationDate, getCalculationMessages, getCalculationStartDate, getJobName, getLabel, getLocale, getStatus, getTargetDate, isAnonymousCalculable, setCalculationDate, setCalculationMessages, setCalculationMessages, setCalculationStartDate, setLabel, setLocale, setStatus, setTargetDateMethods inherited from class PartitionedObject
addUniqueConstraint, getLoginNameByUserId, getPartition, setPartition, toStringMethods inherited from class PersistedObject
auditOperation, bumpVersion, canAdd, canEdit, canRead, createDate, entityIsSafeInserted, entityIsSafeInserted, getBulkloadMap, getBusinessKey, getCreateDate, getCreatedBy, getDbColumnNameForField, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getSensitiveFields, getSignificantFields, getTypeCode, getTypedId, getVersion, getVirtualSearchFieldMappings, getVirtualSortFieldMappings, isAudited, isDeleted, isVirtualSearchField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, onDelete, onRefreshed, onSavedOrUpdated, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilter, userGroupEditBulkloadFilterMethods inherited from class DomainObject
deepCopy, getNewMidnightDate, getNewMidnightDateTime, isMidnight, isMidnight, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerializedSizeOK, jsonSerializeToBytes, jsonSerializeToBytes, setToDayEnd, setToDayEnd, setToMidnight, setToMidnight, setToMidnightAsLocalDateTime, toPropertyMap, truncatedToStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Approvable
canBeSubmitted, getLabel, getTypedId, getWorkflowFormulaBinding, getWorkflowFormulaTargetDate, isInFinalState, isSubmitted, onNoApprovalRequiredMethods inherited from interface NamedChangeTracker
contextCurrentUser, getCreatedBy, setCreatedAndLastUpdated, setLastUpdateByMethods inherited from interface Persistable
getCreateDate, getCreatedBy, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getTypeCode, getTypedId, getVersion, isDeleted, setCreateDate, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setVersion
-
Constructor Details
-
Pricelist
public Pricelist() -
Pricelist
-
-
Method Details
-
getConfiguration
-
setConfiguration
-
getUniqueName
- Specified by:
getUniqueNamein interfaceApprovable
-
getPricelistConfiguration
public PricelistConfiguration getPricelistConfiguration() -
setPricelistConfiguration
public void setPricelistConfiguration(PricelistConfiguration config) -
getProcessingMode
-
setProcessingMode
-
getErrorMode
-
setErrorMode
-
getPricelistType
public MatrixableCalculableObject.ListType getPricelistType() -
setPricelistType
public void setPricelistType(MatrixableCalculableObject.ListType pricelistType) -
getListType
public MatrixableCalculableObject.ListType getListType()- Overrides:
getListTypein classMatrixableCalculableObject
-
isMatrix
public boolean isMatrix()- Overrides:
isMatrixin classMatrixableCalculableObject
-
getNodeId
- Specified by:
getNodeIdin interfaceTreeStructuredObject
-
setNodeId
- Specified by:
setNodeIdin interfaceTreeStructuredObject
-
getPreviousPricelistId
-
setPreviousPricelistId
-
getExpiryDate
-
setExpiryDate
-
getApprovalState
-
setApprovalState
-
getApprovalDate
-
approvalDate
-
setApprovalDate
-
getExportDate
-
exportDate
-
setExportDate
-
getDescription
-
setDescription
-
getUserGroupEdit
- Specified by:
getUserGroupEditin interfaceUserGroupRestrictedObject
-
setUserGroupEdit
- Specified by:
setUserGroupEditin interfaceUserGroupRestrictedObject
-
getUserGroupViewDetails
- Specified by:
getUserGroupViewDetailsin interfaceUserGroupRestrictedObject
-
setUserGroupViewDetails
- Specified by:
setUserGroupViewDetailsin interfaceUserGroupRestrictedObject
-
getPricelistPricegridTypeUniqueName
-
setPricelistPricegridTypeUniqueName
-
setHeaderType
public void setHeaderType(PriceListTypeOnly priceListType) -
getIntegrationStatus
-
setIntegrationStatus
-
getUpdatedBy
-
setUpdateDate
-
setUpdatedBy
-
getUpdateDate
-
getPricelistId
-
setPricelistId
-
getJstId
-
setJstId
-
validate
public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService) Description copied from class:net.pricefx.domain.PersistedObjectOverride to implement per-object validation rules- Specified by:
validatein interfacePersistable- Overrides:
validatein classAbstractCalculable- Parameters:
validationVisitor- visitor object that receives validation error detailsobjService- PersistedObjectService instance. May be null, so be cautious when requiring it
-
canEdit
public boolean canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String, Object> fieldsToEdit) Description copied from class:net.pricefx.domain.PersistedObjectOverride this method to do edit-ability checks based on request details and object data (or related object data) and new data from request In case of a false return value a validation error should be added.- Overrides:
canEditin classPersistedObject- Parameters:
user- that requests edit accessvalidationVisitor- receives any "not allowed messages"objService- needed for cross object edit-ability checks. Implemented as parameter to optimize performance (vs. new object creation)fieldsToEdit- fields and their values that are about to be modified. To implement more fine-grained edit-ability checks (like e.g. allow tree repositioning while the object is otherwise locked)- Returns:
- true if edit is allowed, false otherwise
-
canDelete
public boolean canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService) Description copied from class:net.pricefx.domain.PersistedObjectOverride this method to restrict the possibility to delete an object of this type.Default: true
- Overrides:
canDeletein classPersistedObject- Parameters:
user- that requests delete accessvalidationVisitor- receives any "not allowed messages"objService- needed for cross object edit-ability checks. Implemented as parameter to optimize performance (vs. new object creation)
-
getItemClass
- Specified by:
getItemClassin interfaceHasCalculableObjectItems
-
getItemClassS
public static Class<? extends AbstractPricelistItem> getItemClassS(MatrixableCalculableObject.ListType type) -
getItemListFilterField
- Specified by:
getItemListFilterFieldin interfaceHasCalculableObjectItems
-
getItemListFilterFieldS
-
getItemAttributeMetaClass
- Specified by:
getItemAttributeMetaClassin interfaceHasCalculableObjectItems
-
onSubmit
- Specified by:
onSubmitin interfaceApprovable
-
onApprove
Description copied from interface:net.pricefx.domain.ApprovableCalled from the workflow engine.- Specified by:
onApprovein interfaceApprovable- Returns:
- if non-null treated as error. WF engine does not approve this step
-
onWithdraw
Description copied from interface:net.pricefx.domain.ApprovableCalled from the workflow engine.- Specified by:
onWithdrawin interfaceApprovable- Parameters:
withdrawer- user on whose behalf the withdrawal is done- Returns:
- if non-null treated as error. WF engine does not withdraw
-
onDeny
Description copied from interface:net.pricefx.domain.ApprovableCalled from the workflow engine.- Specified by:
onDenyin interfaceApprovable- Parameters:
denier-- Returns:
- if non-null treated as error. WF engine does not withdraw
-
onApproved
Description copied from interface:net.pricefx.domain.ApprovableCalled from the workflow engine, one the workflow is completed- Specified by:
onApprovedin interfaceApprovable
-
onApproved
Description copied from interface:net.pricefx.domain.ApprovableCalled from the workflow engine, one the workflow is completed- Specified by:
onApprovedin interfaceApprovable
-
onNoApprovalRequired
public void onNoApprovalRequired(User approver, WorkflowDTO workflowDTO, ApprovalActionsService approvalActionsService) Description copied from interface:net.pricefx.domain.ApprovableCalled in case no approval is required (but the approvable was submitted- Specified by:
onNoApprovalRequiredin interfaceApprovable- Parameters:
approver-
-
typeName
Description copied from interface:net.pricefx.domain.ApprovableTypically the lowercased class name of the approvable object (e.g. "quote") Used to set the uniqueName of the WorkflowFormula (to make the link) and for the groovy binding name- Specified by:
typeNamein interfaceApprovable- Returns:
-
processPostLoad
public void processPostLoad()Description copied from interface:net.pricefx.domain.ApprovableInits the loaded Approvable.- Specified by:
processPostLoadin interfaceApprovable
-
getWorkflowStatus
public Workflow.WorkflowStatus getWorkflowStatus()- Specified by:
getWorkflowStatusin interfaceApprovable
-
setWorkflowStatus
public void setWorkflowStatus(Workflow.WorkflowStatus workflowStatus) Possible workflowStatus values: DRAFT, SUBMITTED, DENIED, APPROVED, NO_APPROVAL_REQUIRED, WITHDRAWN, INVALIDATED- Specified by:
setWorkflowStatusin interfaceApprovable- See Also:
-
getUniqueNamePrefix
- Specified by:
getUniqueNamePrefixin interfaceApprovable- Parameters:
objService-- Returns:
-
getParentTypedId
- Specified by:
getParentTypedIdin interfaceApprovable- Returns:
- typedId of parent or
nullif approvable has no parent.
-
getSubmittedByName
- Specified by:
getSubmittedByNamein interfaceApprovable
-
getHasCriticalAlert
public boolean getHasCriticalAlert() -
setHasCriticalAlert
-
getWfLastExecutedByName
- Specified by:
getWfLastExecutedByNamein interfaceApprovable
-
getApprovedByName
- Specified by:
getApprovedByNamein interfaceApprovable
-
getDeniedByName
- Specified by:
getDeniedByNamein interfaceApprovable
-
setApprovedByName
-
setDeniedByName
-
getSubmitDate
-
submitDate
-
setSubmitDate
-
setItemApprovalReason
Description copied from interface:net.pricefx.domain.ApprovableSets item level reason texts. Useful if the approval is on header level, but the reasons should be outlined on the individual items- Specified by:
setItemApprovalReasonin interfaceApprovable- Parameters:
reasons- A map containing values in the form "itemTypedId : reason"
-
getApprovalRequiredEmailAttachments
Description copied from interface:net.pricefx.domain.ApprovableA list of attachments to attach into approval-required emailsNote: at the moment, individual items must either be an instance of BinaryData, or its TypedId, or a
Searchupon the BinaryData entity- Specified by:
getApprovalRequiredEmailAttachmentsin interfaceApprovable
-
onSaveOrUpdate
public void onSaveOrUpdate(PersistedObjectService objService) Description copied from class:net.pricefx.domain.PersistedObjectDefault does nothing. Method is called when object is about to be saved or updated Override point- Overrides:
onSaveOrUpdatein classPersistedObject
-
fillSubmitter
-
fillWfLastExecutedByName
-
updatePricelistHeader
public void updatePricelistHeader(PersistedObjectService objService) -
resetWorkflow
public void resetWorkflow(PersistedObjectService objService) -
getDefaultTrackerType
public JobStatusTracker.TrackerType getDefaultTrackerType()- Specified by:
getDefaultTrackerTypein classAbstractCalculable
-
itemsStateChanged
public void itemsStateChanged(PersistedObjectService objService) - Overrides:
itemsStateChangedin classCalculableObject
-
doHardDelete
public boolean doHardDelete()Description copied from class:net.pricefx.domain.PersistedObjectOverride to define if an object instance should be really deleted (vs just marked as deleted) Default: soft-delete- Specified by:
doHardDeletein interfacePersistable- Overrides:
doHardDeletein classAbstractCalculable
-
getCreatedByName
- Specified by:
getCreatedByNamein interfaceNamedChangeTracker
-
setCreatedByName
- Specified by:
setCreatedByNamein interfaceNamedChangeTracker
-
getLastUpdateByName
-
setLastUpdateByName
- Specified by:
setLastUpdateByNamein interfaceNamedChangeTracker
-
onPreProcessing
Description copied from interface:net.pricefx.domain.APIModifiableInvoked before processing starts. Good point to normalize the structure. For instance lookup LookupTable and set it into the values.- Specified by:
onPreProcessingin interfaceAPIModifiable- Parameters:
values-- Returns:
- false when processing should be stopped
-
getJobType
- Specified by:
getJobTypein interfaceJobSettingsProvider
-
isShotgunEnabled
public boolean isShotgunEnabled()- Specified by:
isShotgunEnabledin interfaceJobSettingsProvider
-
getShotgunThreshold
public int getShotgunThreshold(PersistedObjectService objService, JobStatusTracker jst) - Specified by:
getShotgunThresholdin interfaceJobSettingsProvider
-
jobSize
public int jobSize(PersistedObjectService objectService, JobStatusTracker jst, int runNumber) - Specified by:
jobSizein interfaceJobSettingsProvider
-
getAgentOption1
public Object getAgentOption1(PersistedObjectService objService, JobStatusTracker jst, int runNumber) - Specified by:
getAgentOption1in interfaceJobSettingsProvider
-