Class Pricelist

Object
DomainObject
PersistedObject
PartitionedObject
AbstractCalculable
CalculableObject
MatrixableCalculableObject
Pricelist
All Implemented Interfaces:
APIModifiable, Approvable, Calculable, HasCalculableObjectItems, JobNameProvider, JobSettingsProvider, NamedChangeTracker, TreeStructuredObject, UserGroupRestrictedObject

@Entity public class Pricelist extends MatrixableCalculableObject implements TreeStructuredObject, UserGroupRestrictedObject, Approvable, APIModifiable, NamedChangeTracker, JobSettingsProvider
A Price List (PL, type code PL) is a set of products with a calculated result price, based on a calculation logic, valid as of a target date. It is one of the core Price Setting entities, alongside PriceGrid and Simulation.

A calculation logic (Nature generic/default) calculates one line item at a time; the Price List header is not passed to it as an object. In recalculation mode api.currentItem() returns the line item being recalculated, and the self binding holds previousPricelistId. A Matrix Price List also uses a matrix-nature logic, which only returns the secondary keys (key2) for each SKU.

To read a Price List from a logic, use api.findPricelists(targetDate, listName). api.pricelist() and api.pricelistItem() read prices only from APPROVED lists whose target date is on or before the given date and whose expiry date is empty or after it. Line items have the type code PLI (XPLI for a Matrix Price List, see getPricelistType()) and reference their Price List by the pricelistId field.

A Price List can go through an approval workflow if a workflow logic named pricelist is configured on the partition; getWorkflowStatus() and getApprovalState() track its progress. Access to a Price List's detail view and edit actions can be restricted to specific User Groups via getUserGroupViewDetails() and getUserGroupEdit().

Approving a Price List can start a Condition Record job (see onApproved(User, PersistedObjectService)). Its Condition Record logic should only return condition records: data changes, events and job triggers made from it are skipped. Do follow-up actions such as exports in a consumer of the CONDITION_RECORD_CREATION_FINISHED event, whose sourceObjectId is this Price List's typed id.

Example, looking up a Price List by name and checking that it is approved:


 def pl = api.findPricelists(api.targetDate(), "EMEA Q3 List")?.find()
 if (pl?.approvalState?.name() == "APPROVED") {
   // ...
 }
 
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Controls what happens when an individual line item fails during Price List calculation, set via setErrorMode(PricelistErrorModeType).
    static enum 
    Controls how a Price List's line items are (re)populated when the calculation runs, set via setProcessingMode(ProcessingMode).

    Nested classes/interfaces inherited from class MatrixableCalculableObject

    MatrixableCalculableObject.ListType

    Nested classes/interfaces inherited from class PersistedObject

    PersistedObject.BatchDelete, PersistedObject.BulkloadFilterCheckCallback, PersistedObject.ComputedFieldMapping, PersistedObject.ComputedFields, PersistedObject.HardDelete, 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_LENGTH, MAX_CALCULATION_MESSAGE_THRESHOLD

    Fields inherited from class PartitionedObject

    FIELD_PARTITION, FIELD_PARTITIONID, PARTITION_FILTER_NAME, PARTITION_FILTER_PARAM

    Fields inherited from class PersistedObject

    FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ID, FIELD_ISDELETED, FIELD_LASTUPDATEBY, FIELD_LASTUPDATEDATE, FIELD_VERSION

    Fields inherited from interface Approvable

    FIELD_WFLASTEXECUTEDBYNAME

    Fields inherited from interface UserGroupRestrictedObject

    FIELD_USERGROUPEDIT, FIELD_USERGROUPVIEWDETAILS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty Price List; only the list type (SIMPLE) and the critical alert flag (false) are initialized.
    Creates a new Price List seeded from an existing one: copies selected configuration fields (logic parameters, element names, product filter, result element, default logic override and sort keys), the processing mode, the edit and view-details User Groups and the list type, links back to basePl via getPreviousPricelistId(), and carries over the partition and tree node id.
  • Method Summary

    Modifier and Type
    Method
    Description
    The approval date and time formatted for display, using the partition's configured date-time pattern.
    boolean
    canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
    Whether user may delete this Price List.
    boolean
    canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String,Object> fieldsToEdit)
    Whether user may edit this Price List, in addition to the base checks of the superclass (which include the getUserGroupEdit() restriction).
    The export date and time formatted for display, using the partition's configured date-time pattern.
    protected void
    fillSubmitter(User submitter)
     
    protected void
     
    getAgentOption1(PersistedObjectService objService, JobStatusTracker jst, int runNumber)
    A flag passed to the calculation agent.
    The date and time this Price List was last approved, set automatically by onApproved(User, PersistedObjectService).
    List<?>
    Attachments to include in approval-required emails sent for this Price List.
    This Price List's current approval state within its approval workflow, updated automatically as the workflow progresses (see onApproved(User, PersistedObjectService), resetWorkflow(PersistedObjectService)).
    The login name of the last user who approved a workflow step, derived from getWorkflowStatus(), getApprovalState() and getWfLastExecutedByName().
    The raw JSON string backing getPricelistConfiguration().
    The login name of the user who created this Price List, cached at creation time for display without an extra join.
    JobStatusTracker.TrackerType
    The kind of background job tracker used by default when this Price List's calculation runs.
    The login name to show for a denied Price List, derived from getWorkflowStatus(), getApprovalState() and getWfLastExecutedByName().
    A free-text description of this Price List.
    What happens when an individual line item fails during calculation.
    The end of this Price List's validity: lookups such as api.pricelist() and api.findPricelists() consider it only for target dates before this value.
    The date and time this Price List was exported to an external system, as recorded by that integration.
    boolean
    Whether at least one line item raised a critical alert (an alert configured on a logic element, set at the end of the calculation).
    A free-text status for external integrations.
    Class<? extends ElementAttributeMeta>
    The attribute-metadata type describing extension/attribute metadata for this Price List's line items.
    Class<? extends AbstractPricelistItem>
    The concrete line item type backing this Price List's items: PricelistItem for a plain, per-SKU Price List, or MatrixPricelistItem for a Matrix Price List (see getPricelistType()).
    Equivalent to getItemListFilterFieldS(): the entity field name used to look up this Price List's line items.
    static String
    The field on a line item (PLI / XPLI) that references its Price List, for example api.find("PLI", 0, 0, null, ["sku"], Filter.equal("pricelistId", pricelistId)).
    The job-type discriminator used for background calculation job naming/routing.
    The id of the JobStatusTracker of the calculation job queued by the request that returned this object.
    The login name of the user who last updated this Price List, cached at update time for display without an extra join.
    MatrixableCalculableObject.ListType
    Equivalent to getPricelistType().
    This Price List's position in its containing tree hierarchy, used for tree-based navigation.
    Id of a previously calculated Price List whose items are referred to as "old prices" to derive price increases/decreases, and whose product selection is reused when getProcessingMode() is Pricelist.ProcessingMode.NEW_REVISION or Pricelist.ProcessingMode.NEW_REVISION_BYCRITERIA.
    PricelistConfiguration
    The structured configuration of this Price List (calculation logic selection, matrix settings, shotgun mode, and similar options), deserialized from the JSON stored in getConfiguration().
    Equivalent to getId(), exposed under the id JSON property name so the Price List's id is always present in the API response.
    The unique name of the Price Setting Type (PriceListTypeOnly) linked to this Price List via setHeaderType(PriceListTypeOnly), which supplies the header calculation logic used to produce this Price List's summary chart and results.
    MatrixableCalculableObject.ListType
    Whether this is a plain, per-SKU Price List or a Matrix Price List with an extra dimension (for example country or volume tier).
    How this Price List's line items are (re)populated the next time it is calculated.
    int
    getShotgunThreshold(PersistedObjectService objService, JobStatusTracker jst)
    The minimum job size (see jobSize(PersistedObjectService, JobStatusTracker, int)) above which the calculation framework switches into shotgun (distributed) mode instead of a single sequential run, when isShotgunEnabled(PersistedObjectService) allows it.
    The date and time this Price List was last submitted for approval, set by onSubmit(User, PersistedObjectService).
    The login name of the user who submitted this Price List for approval, cached at submission time by onSubmit(User, PersistedObjectService) for display without an extra join.
    A fallback display name for this Price List: the numeric id formatted as a String.
    getUniqueNamePrefix(PersistedObjectService objService)
    The short code prefix combined with this Price List's id to build its display/unique name (for example "PL-123").
    The date and time this Price List was last updated.
    The id of the user who last updated this Price List.
    The User Group(s) whose members may edit and delete this Price List; users outside them are blocked by canEdit(User, ValidationVisitor, PersistedObjectService, Map) and canDelete(User, ValidationVisitor, PersistedObjectService).
    The User Group(s) whose members may view this Price List's details.
    The login name of the last user who approved a workflow step of this Price List, cached for display without an extra join.
    Workflow.WorkflowStatus
    This Price List's current position in its approval workflow.
    boolean
    A shorthand for ListType.MATRIX.equals(getPricelistType()), useful where a full switch over getPricelistType() is not needed.
    boolean
    isShotgunEnabled(PersistedObjectService txn)
    Whether "shotgun mode" (distributed calculation spread across multiple worker agents/pods rather than run sequentially) is allowed for this Price List at all, controlled by the shotgun mode setting in getPricelistConfiguration().
    void
    itemsStateChanged(PersistedObjectService objService)
    Refreshes the header-level item count via updatePricelistHeader(PersistedObjectService), after the superclass handling.
    int
    jobSize(PersistedObjectService objectService, JobStatusTracker jst, int runNumber)
    The size of this Price List's current calculation run: the number of line items the run is expected to process.
    onApprove(User approver, PersistedObjectService objService)
    Called by the workflow engine after an individual approval step on this Price List is approved.
    void
    onApproved(User approver, PersistedObjectService objectService)
    Called by the workflow engine once every approval step on this Price List has completed successfully.
    onDeny(User denier, PersistedObjectService objService, String reason)
    Called by the workflow engine when an approval step on this Price List is denied.
    void
    onNoApprovalRequired(User approver, WorkflowDTO workflowDTO, PersistedObjectService objService, ApprovalActionsService approvalActionsService)
    Called by the workflow engine when this Price List was submitted but the configured workflow logic determined that no approval step applies.
    boolean
    onPreProcessing(PersistedObjectService objService, Map<String,Object> values, LocalDateTime targetDate)
    Called before this Price List is created, updated, or deleted through the API (for example api.update("PL", ...)).
    onSubmit(User submitter, PersistedObjectService objService)
    Called by the workflow engine when this Price List is submitted for approval.
    onWithdraw(User withdrawer, PersistedObjectService objService)
    Called by the workflow engine when this Price List's submission is withdrawn.
    void
    processPostLoad(PersistedObjectService objService)
    Invoked by service-layer code right after this Price List is loaded, before further processing or calculation, to initialize any transient state.
    void
    resetWorkflow(PersistedObjectService objService)
    Reverts this Price List to an unsubmitted state: clears getWorkflowStatus(), sets getApprovalState() back to NOT_APPROVED, clears the cached submitter and last-executor names and the approval date, and raises an ITEM_PL_REVOKED event.
    void
    Sets the approval date.
    void
    Sets the approval state.
    void
    setApprovedByName(String approvedByName)
    No-op setter kept only so the JSON deserializer accepts an incoming approvedByName field; the value is always derived by getApprovedByName() and cannot be set directly.
    void
    setConfiguration(String configuration)
    Stores the raw JSON configuration string.
    void
    setCreatedByName(String createdByName)
    Sets the creator's login name.
    void
    setDeniedByName(String deniedByName)
    No-op setter kept only so the JSON deserializer accepts an incoming deniedByName field; the value is always derived by getDeniedByName() and cannot be set directly.
    void
    setDescription(String description)
    Sets the free-text description of this Price List.
    void
    Sets what happens when an individual line item fails during calculation.
    void
    Sets the end of this Price List's validity (see getExpiryDate()).
    void
    Sets the export date recorded by an external integration.
    void
    setHasCriticalAlert(Boolean hasCriticalAlert)
    Set by the calculation.
    void
    setHeaderType(PriceListTypeOnly priceListType)
    Links this Price List to a Price Setting Type, which supplies its header calculation logic (Nature coHeader) used to compute the summary chart and results shown on this Price List.
    void
    setIntegrationStatus(String integrationStatus)
    Sets the free-text integration status (see getIntegrationStatus()).
    void
    Intended to record per-item approval reasons when this Price List's approval is decided at header level but reasons should be shown on individual line items.
    void
    setJstId(Long jstId)
    Records the calculation job queued for this Price List.
    void
    setLastUpdateByName(String lastUpdateByName)
    Sets the login name of the last updating user.
    void
    setNodeId(Number nodeId)
    Sets this Price List's position in its tree hierarchy.
    void
    setPreviousPricelistId(Long previousPricelistId)
    Sets the Price List this one is a revision of (see getPreviousPricelistId()).
    void
    setPricelistConfiguration(PricelistConfiguration config)
    Serializes the given configuration to JSON and stores it as this Price List's getConfiguration().
    void
    No-op setter kept only so the JSON deserializer accepts an incoming id field without failing; the id cannot be set directly.
    void
    setPricelistPricegridTypeUniqueName(String pricelistPricegridTypeUniqueName)
    No-op setter kept only so the JSON deserializer accepts the headerTypeUniqueName field on incoming payloads.
    void
    setPricelistType(MatrixableCalculableObject.ListType pricelistType)
    Sets whether this is a plain, per-SKU Price List or a Matrix Price List.
    void
    Sets how this Price List's line items are (re)populated the next time it is calculated.
    void
    Sets the submission date.
    void
    No-op setter kept only so the JSON deserializer accepts an incoming updateDate field; the actual last-update timestamp is maintained internally and cannot be set directly.
    void
    setUpdatedBy(Long updateBy)
    No-op setter kept only so the JSON deserializer accepts an incoming updatedBy field; the actual last-updating user is maintained internally and cannot be set directly.
    void
    Sets the User Group(s) whose members may edit and delete this Price List (see getUserGroupEdit()).
    void
    Sets the User Group(s) whose members may view this Price List's details (see getUserGroupViewDetails()).
    void
    setWorkflowStatus(Workflow.WorkflowStatus workflowStatus)
    Sets this Price List's workflow status.
    The submission date and time formatted for display, using the partition's configured date-time pattern.
    The lowercased type identifier for this Approvable, used as the unique name of its WorkflowFormula and as the Groovy binding name in workflow logics.
    void
    updatePricelistHeader(PersistedObjectService objService)
    Recounts this Price List's line items and stores the count as its header-level item count.
    boolean
    validate(ValidationVisitor validationVisitor, PersistedObjectService objService)
    Validates this Price List before it is saved, in addition to the base validation performed by the superclass.

    Methods inherited from class MatrixableCalculableObject

    anyToRecalculation

    Methods inherited from class CalculableObject

    getEffectiveTargetDate, getKeepManualOverrides, getNumberOfItems, getWriteOnlyChangedItems, setKeepManualOverrides, setNumberOfItems, setWriteOnlyChangedItems

    Methods inherited from class AbstractCalculable

    calculationDate, calculationStartDate, getCalculationConcurrencyKey, getCalculationDate, getCalculationMessages, getCalculationMessagesAsList, getCalculationStartDate, getJobName, getLabel, getLocale, getStatus, getTargetDate, isAnonymousCalculable, setCalculationDate, setCalculationMessages, setCalculationMessages, setCalculationStartDate, setLabel, setLocale, setStatus, setTargetDate

    Methods inherited from class PartitionedObject

    addUniqueConstraint, getLoginNameByUserId, getPartition, setPartition, toString

    Methods inherited from class PersistedObject

    auditOperation, bumpVersion, canAdd, canEdit, canRead, canReadElements, createDate, entityIsHardDeleted, entityIsMassDeletable, entityIsSafeInserted, entityIsSafeInserted, getBulkloadMap, getBusinessKey, getCreateDate, getCreatedBy, getDbColumnNameForField, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getSensitiveFields, getSignificantFields, getTypeCode, getTypedId, getVersion, getVirtualSearchFieldMappings, getVirtualSortFieldMappings, isAudited, isDeleted, isHardDeleted, isVirtualSearchField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, onDelete, onRefreshed, onSavedOrUpdated, onSaveOrUpdate, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilter, userGroupEditBulkloadFilter

    Methods 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, truncatedToString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Approvable

    canBeSubmitted, getApprovableParentTypedId, getLabel, getTypedId, getWorkflowFormulaBinding, getWorkflowFormulaTargetDate, invalidateWorkflow, isInFinalState, isSubmitted
  • Constructor Details

    • Pricelist

      public Pricelist()
      Creates an empty Price List; only the list type (SIMPLE) and the critical alert flag (false) are initialized.
    • Pricelist

      public Pricelist(Pricelist basePl)
      Creates a new Price List seeded from an existing one: copies selected configuration fields (logic parameters, element names, product filter, result element, default logic override and sort keys), the processing mode, the edit and view-details User Groups and the list type, links back to basePl via getPreviousPricelistId(), and carries over the partition and tree node id. The Price Setting Type link, matrix logic settings, shotgun mode, header inputs and notification setting are not copied.
      Parameters:
      basePl - The Price List to copy from, or null to create an empty Price List equivalent to Pricelist().
  • Method Details

    • getConfiguration

      public String getConfiguration()
      The raw JSON string backing getPricelistConfiguration(). Used for persistence.
      Returns:
      The JSON-encoded configuration, or null if none has been set yet.
      See Also:
    • setConfiguration

      public void setConfiguration(String configuration)
      Stores the raw JSON configuration string. Used for persistence. To change a Price List's configuration from a logic, use api.update("PL", ...) with a configuration map.
      Parameters:
      configuration - The JSON-encoded configuration to store.
    • getUniqueName

      public String getUniqueName()
      A fallback display name for this Price List: the numeric id formatted as a String. Unlike most Pricefx entities, a Price List has no user-entered natural key of its own to fall back on here.
      Specified by:
      getUniqueName in interface Approvable
      Returns:
      The id of this Price List, as a String.
    • getPricelistConfiguration

      public PricelistConfiguration getPricelistConfiguration()
      The structured configuration of this Price List (calculation logic selection, matrix settings, shotgun mode, and similar options), deserialized from the JSON stored in getConfiguration().
      Returns:
      The parsed configuration. Never null: an empty PricelistConfiguration is returned when none has been set yet.
      See Also:
    • setPricelistConfiguration

      public void setPricelistConfiguration(PricelistConfiguration config)
      Serializes the given configuration to JSON and stores it as this Price List's getConfiguration().
      Parameters:
      config - The configuration to store.
    • getProcessingMode

      public Pricelist.ProcessingMode getProcessingMode()
      How this Price List's line items are (re)populated the next time it is calculated.
      Returns:
      The configured Pricelist.ProcessingMode. Set by every Price List creation and revision path; a calculation requires it to be non-null.
    • setProcessingMode

      public void setProcessingMode(Pricelist.ProcessingMode processingMode)
      Sets how this Price List's line items are (re)populated the next time it is calculated.
      Parameters:
      processingMode - How this Price List's line items should be (re)populated the next time it is calculated.
    • getErrorMode

      public Pricelist.PricelistErrorModeType getErrorMode()
      What happens when an individual line item fails during calculation.
      Returns:
      The configured Pricelist.PricelistErrorModeType. Defaults to Pricelist.PricelistErrorModeType.ABORT when none has been set.
    • setErrorMode

      public void setErrorMode(Pricelist.PricelistErrorModeType errorMode)
      Sets what happens when an individual line item fails during calculation.
      Parameters:
      errorMode - What should happen when an individual line item fails during calculation.
    • getPricelistType

      public MatrixableCalculableObject.ListType getPricelistType()
      Whether this is a plain, per-SKU Price List or a Matrix Price List with an extra dimension (for example country or volume tier). This also determines the line item type returned by getItemClass().
      Returns:
      The configured list type. Defaults to ListType.SIMPLE when none has been set.
    • setPricelistType

      public void setPricelistType(MatrixableCalculableObject.ListType pricelistType)
      Sets whether this is a plain, per-SKU Price List or a Matrix Price List.
      Parameters:
      pricelistType - Whether this Price List should be a plain, per-SKU list or a Matrix list with an extra dimension.
    • getListType

      public MatrixableCalculableObject.ListType getListType()
      Equivalent to getPricelistType().
      Overrides:
      getListType in class MatrixableCalculableObject
      Returns:
      The configured list type. Defaults to ListType.SIMPLE when none has been set.
    • isMatrix

      public boolean isMatrix()
      A shorthand for ListType.MATRIX.equals(getPricelistType()), useful where a full switch over getPricelistType() is not needed.
      Overrides:
      isMatrix in class MatrixableCalculableObject
      Returns:
      true if this is a Matrix Price List, false otherwise.
    • getNodeId

      public Long getNodeId()
      This Price List's position in its containing tree hierarchy, used for tree-based navigation. Not related to line items or calculation.
      Specified by:
      getNodeId in interface TreeStructuredObject
      Returns:
      The tree node id, or null if this Price List is not attached to a tree node.
    • setNodeId

      public void setNodeId(Number nodeId)
      Sets this Price List's position in its tree hierarchy. Only Long, Integer, Short and Byte values are applied; any other value, null included, is ignored, so the link cannot be cleared this way.
      Specified by:
      setNodeId in interface TreeStructuredObject
      Parameters:
      nodeId - The tree node id to assign.
    • getPreviousPricelistId

      public Long getPreviousPricelistId()
      Id of a previously calculated Price List whose items are referred to as "old prices" to derive price increases/decreases, and whose product selection is reused when getProcessingMode() is Pricelist.ProcessingMode.NEW_REVISION or Pricelist.ProcessingMode.NEW_REVISION_BYCRITERIA.
      Returns:
      The id of the referenced Price List, or null if this is not a revision of another Price List.
    • setPreviousPricelistId

      public void setPreviousPricelistId(Long previousPricelistId)
      Sets the Price List this one is a revision of (see getPreviousPricelistId()).
      Parameters:
      previousPricelistId - The id of the Price List this one is a revision of, or null to clear the link.
    • getExpiryDate

      public LocalDateTime getExpiryDate()
      The end of this Price List's validity: lookups such as api.pricelist() and api.findPricelists() consider it only for target dates before this value. It must not be before the target date (checked by validate(ValidationVisitor, PersistedObjectService)).
      Returns:
      The expiry date and time, or null if the Price List has no end of validity.
    • setExpiryDate

      public void setExpiryDate(LocalDateTime expiryDate)
      Sets the end of this Price List's validity (see getExpiryDate()).
      Parameters:
      expiryDate - The end of this Price List's validity, or null for no end.
    • getApprovalState

      public ApprovalState getApprovalState()
      This Price List's current approval state within its approval workflow, updated automatically as the workflow progresses (see onApproved(User, PersistedObjectService), resetWorkflow(PersistedObjectService)). Deleting an already-APPROVED or partially-approved Price List additionally requires the PRICELIST_REMOVE_APPROVED permission, enforced by canDelete(User, ValidationVisitor, PersistedObjectService).
      Returns:
      The current ApprovalState; NOT_APPROVED until the Price List is approved. null only on old records created before the field was introduced.
    • setApprovalState

      public void setApprovalState(ApprovalState approvalState)
      Sets the approval state. The approval workflow overwrites it as the Price List is approved or its workflow is reset. Not meant to be used directly in Groovy.
      Parameters:
      approvalState - The approval state to assign.
    • getApprovalDate

      public LocalDateTime getApprovalDate()
      The date and time this Price List was last approved, set automatically by onApproved(User, PersistedObjectService).
      Returns:
      The approval date and time, or null if this Price List has not been approved (or its approval was subsequently reset, see resetWorkflow(PersistedObjectService)).
    • approvalDate

      public String approvalDate()
      The approval date and time formatted for display, using the partition's configured date-time pattern. Serialized under the JSON property approvalDate in place of the raw getApprovalDate() value.
      Returns:
      The formatted approval date and time, or null if this Price List has not been approved.
    • setApprovalDate

      public void setApprovalDate(LocalDateTime approvalDate)
      Sets the approval date. Set by onApproved(User, PersistedObjectService) and cleared by resetWorkflow(PersistedObjectService). Not meant to be used directly in Groovy.
      Parameters:
      approvalDate - The date and time this Price List was approved, or null to clear it.
    • getExportDate

      public LocalDateTime getExportDate()
      The date and time this Price List was exported to an external system, as recorded by that integration. The platform neither sets nor interprets it.
      Returns:
      The export date and time, or null if none is recorded.
    • exportDate

      public String exportDate()
      The export date and time formatted for display, using the partition's configured date-time pattern. Serialized under the JSON property exportDate in place of the raw getExportDate() value.
      Returns:
      The formatted export date and time, or null if this Price List has not been exported.
    • setExportDate

      public void setExportDate(LocalDateTime exportDate)
      Sets the export date recorded by an external integration.
      Parameters:
      exportDate - The date and time this Price List was exported, or null to clear it.
    • getDescription

      public String getDescription()
      A free-text description of this Price List.
      Returns:
      The description. May be null.
    • setDescription

      public void setDescription(String description)
      Sets the free-text description of this Price List.
      Parameters:
      description - A free-text description of this Price List. A value longer than 255 characters fails validation on save (see validate(ValidationVisitor, PersistedObjectService)).
    • getUserGroupEdit

      public String getUserGroupEdit()
      The User Group(s) whose members may edit and delete this Price List; users outside them are blocked by canEdit(User, ValidationVisitor, PersistedObjectService, Map) and canDelete(User, ValidationVisitor, PersistedObjectService). Users with the USERGROUP_OVERRIDE permission bypass the restriction.
      Specified by:
      getUserGroupEdit in interface UserGroupRestrictedObject
      Returns:
      A User Group unique name or a comma-separated list of them, or null if editing is not restricted by User Group.
    • setUserGroupEdit

      public void setUserGroupEdit(String userGroup)
      Sets the User Group(s) whose members may edit and delete this Price List (see getUserGroupEdit()).
      Specified by:
      setUserGroupEdit in interface UserGroupRestrictedObject
      Parameters:
      userGroup - A User Group unique name or a comma-separated list of them, or null to remove the restriction.
    • getUserGroupViewDetails

      public String getUserGroupViewDetails()
      The User Group(s) whose members may view this Price List's details. Members of the edit User Group(s) (getUserGroupEdit()) may view the details too, and users with the USERGROUP_OVERRIDE permission bypass the restriction.
      Specified by:
      getUserGroupViewDetails in interface UserGroupRestrictedObject
      Returns:
      A User Group unique name or a comma-separated list of them, or null if viewing is not restricted by User Group.
    • setUserGroupViewDetails

      public void setUserGroupViewDetails(String userGroup)
      Sets the User Group(s) whose members may view this Price List's details (see getUserGroupViewDetails()).
      Specified by:
      setUserGroupViewDetails in interface UserGroupRestrictedObject
      Parameters:
      userGroup - A User Group unique name or a comma-separated list of them, or null to remove the restriction.
    • getPricelistPricegridTypeUniqueName

      public String getPricelistPricegridTypeUniqueName()
      The unique name of the Price Setting Type (PriceListTypeOnly) linked to this Price List via setHeaderType(PriceListTypeOnly), which supplies the header calculation logic used to produce this Price List's summary chart and results.
      Returns:
      The linked Price Setting Type's unique name, or null if none is linked.
      See Also:
    • setPricelistPricegridTypeUniqueName

      public void setPricelistPricegridTypeUniqueName(String pricelistPricegridTypeUniqueName)
      No-op setter kept only so the JSON deserializer accepts the headerTypeUniqueName field on incoming payloads. The link to a Price Setting Type is set when the Price List is created, from plTypeTypeId in its configuration.
      Parameters:
      pricelistPricegridTypeUniqueName - Ignored.
    • setHeaderType

      public void setHeaderType(PriceListTypeOnly priceListType)
      Links this Price List to a Price Setting Type, which supplies its header calculation logic (Nature coHeader) used to compute the summary chart and results shown on this Price List.
      Parameters:
      priceListType - The Price Setting Type to link, or null to remove the link.
    • getIntegrationStatus

      public String getIntegrationStatus()
      A free-text status for external integrations. The platform neither sets nor interprets it.
      Returns:
      The integration status. May be null.
    • setIntegrationStatus

      public void setIntegrationStatus(String integrationStatus)
      Sets the free-text integration status (see getIntegrationStatus()).
      Parameters:
      integrationStatus - The integration/export status to record.
    • getUpdatedBy

      public Long getUpdatedBy()
      The id of the user who last updated this Price List. Re-exposes getLastUpdateBy() under the updatedBy JSON property name used by the Price List and price item payloads.
      Returns:
      The last-updating user's id, or null if not yet updated.
    • setUpdateDate

      public void setUpdateDate(LocalDateTime updateDate)
      No-op setter kept only so the JSON deserializer accepts an incoming updateDate field; the actual last-update timestamp is maintained internally and cannot be set directly.
      Parameters:
      updateDate - Ignored.
    • setUpdatedBy

      public void setUpdatedBy(Long updateBy)
      No-op setter kept only so the JSON deserializer accepts an incoming updatedBy field; the actual last-updating user is maintained internally and cannot be set directly.
      Parameters:
      updateBy - Ignored.
    • getUpdateDate

      public LocalDateTime getUpdateDate()
      The date and time this Price List was last updated. Re-exposes getLastUpdateDate() under the updateDate JSON property name used by the Price List and price item payloads.
      Returns:
      The last-update date and time, or null if not yet updated.
    • getPricelistId

      public Long getPricelistId()
      Equivalent to getId(), exposed under the id JSON property name so the Price List's id is always present in the API response.
      Returns:
      This Price List's id.
    • setPricelistId

      public void setPricelistId(Long id)
      No-op setter kept only so the JSON deserializer accepts an incoming id field without failing; the id cannot be set directly.
      Parameters:
      id - Ignored.
    • getJstId

      public Long getJstId()
      The id of the JobStatusTracker of the calculation job queued by the request that returned this object. Not persisted: a Price List loaded later (for example via api.findPricelists) returns null.
      Returns:
      The job status tracker id, or null on a loaded Price List.
    • setJstId

      public void setJstId(Long jstId)
      Records the calculation job queued for this Price List. Not meant to be used directly in Groovy.
      Parameters:
      jstId - The id of the JobStatusTracker of the queued calculation job.
    • validate

      public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService)
      Validates this Price List before it is saved, in addition to the base validation performed by the superclass. Rejects a getDescription() longer than 255 characters, and rejects a getExpiryDate() that falls before the target date. Not meant to be used directly in Groovy.
      Overrides:
      validate in class AbstractCalculable
      Parameters:
      validationVisitor - Receives a validation error when this Price List is invalid. May be null, in which case errors are simply not recorded.
      objService - Used to delegate to the superclass validation.
      Returns:
      true if this Price List is valid, false otherwise.
    • canEdit

      public boolean canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String,Object> fieldsToEdit)
      Whether user may edit this Price List, in addition to the base checks of the superclass (which include the getUserGroupEdit() restriction). If the Price List already has a target date, changing targetDate is rejected unless the feature flag pricelistTargetDateEditable is enabled. Not meant to be used directly in Groovy.
      Overrides:
      canEdit in class PersistedObject
      Parameters:
      user - The user attempting the edit.
      validationVisitor - Receives a validation error when the edit is not allowed. May be null, in which case errors are simply not recorded.
      objService - Used to read the pricelistTargetDateEditable feature flag and to delegate to the superclass check.
      fieldsToEdit - The fields the caller intends to change, keyed by field name, or null when the check is not scoped to specific fields.
      Returns:
      true if the edit is allowed, false otherwise.
    • canDelete

      public boolean canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
      Whether user may delete this Price List. Deleting a Price List whose getApprovalState() is APPROVED or PARTIALLY_APPROVED requires the PRICELIST_REMOVE_APPROVED permission; in every case the user must also pass canEdit(User, ValidationVisitor, PersistedObjectService, Map). Not meant to be used directly in Groovy.
      Overrides:
      canDelete in class PersistedObject
      Parameters:
      user - The user attempting the delete.
      validationVisitor - Receives a validation error when the delete is not allowed. May be null, in which case errors are simply not recorded.
      objService - Used to delegate to canEdit(User, ValidationVisitor, PersistedObjectService, Map).
      Returns:
      true if the delete is allowed, false otherwise.
    • getItemClass

      public Class<? extends AbstractPricelistItem> getItemClass()
      The concrete line item type backing this Price List's items: PricelistItem for a plain, per-SKU Price List, or MatrixPricelistItem for a Matrix Price List (see getPricelistType()). Used generically by item-management code to instantiate and query this Price List's line items. Not meant to be used directly in Groovy.
      Specified by:
      getItemClass in interface HasCalculableObjectItems
      Returns:
      The line item class corresponding to getPricelistType().
    • getItemListFilterField

      public String getItemListFilterField()
      Equivalent to getItemListFilterFieldS(): the entity field name used to look up this Price List's line items. Not meant to be used directly in Groovy.
      Specified by:
      getItemListFilterField in interface HasCalculableObjectItems
      Returns:
      "pricelistId".
    • getItemListFilterFieldS

      public static String getItemListFilterFieldS()
      The field on a line item (PLI / XPLI) that references its Price List, for example api.find("PLI", 0, 0, null, ["sku"], Filter.equal("pricelistId", pricelistId)). The method itself is not meant to be used directly in Groovy; use the field name "pricelistId" instead.
      Returns:
      "pricelistId".
    • getItemAttributeMetaClass

      public Class<? extends ElementAttributeMeta> getItemAttributeMetaClass()
      The attribute-metadata type describing extension/attribute metadata for this Price List's line items.
      Specified by:
      getItemAttributeMetaClass in interface HasCalculableObjectItems
      Returns:
      PricelistItemAttributeMeta.class.
    • onSubmit

      public String onSubmit(User submitter, PersistedObjectService objService)
      Called by the workflow engine when this Price List is submitted for approval. Records submitter as the submitting user (see getSubmittedByName()) and stamps getSubmitDate() with the current time. Not meant to be used directly in Groovy.
      Specified by:
      onSubmit in interface Approvable
      Parameters:
      submitter - The user submitting this Price List for approval.
      objService - Unused by this implementation; present for the Approvable contract.
      Returns:
      Always null; callers ignore the return value.
    • onApprove

      public String onApprove(User approver, PersistedObjectService objService)
      Called by the workflow engine after an individual approval step on this Price List is approved. Records approver as the last user to execute a workflow step (see getWfLastExecutedByName()). Not meant to be used directly in Groovy.
      Specified by:
      onApprove in interface Approvable
      Parameters:
      approver - The user approving the current workflow step.
      objService - Unused by this implementation; present for the Approvable contract.
      Returns:
      null. A non-null value would be treated as an error blocking the step's approval.
    • onWithdraw

      public String onWithdraw(User withdrawer, PersistedObjectService objService)
      Called by the workflow engine when this Price List's submission is withdrawn. Not meant to be used directly in Groovy.
      Specified by:
      onWithdraw in interface Approvable
      Parameters:
      withdrawer - The user withdrawing the submission (may be acting on behalf of the original submitter).
      objService - Unused by this implementation; present for the Approvable contract.
      Returns:
      null. A non-null value would be treated as an error blocking the withdrawal.
    • onDeny

      public String onDeny(User denier, PersistedObjectService objService, String reason)
      Called by the workflow engine when an approval step on this Price List is denied. Not meant to be used directly in Groovy.
      Specified by:
      onDeny in interface Approvable
      Parameters:
      denier - The user denying the workflow step.
      objService - Unused by this implementation; present for the Approvable contract.
      reason - An optional denial reason supplied by denier. May be null.
      Returns:
      null. A non-null value would be treated as an error blocking the denial.
    • onApproved

      public void onApproved(User approver, PersistedObjectService objectService)
      Called by the workflow engine once every approval step on this Price List has completed successfully. Records approver as the last user to execute a workflow step, sets getApprovalState() to APPROVED, stamps getApprovalDate() with the current time, and raises an ITEM_APPROVED_PL event. When a Condition Record logic is configured (as the workflow's default or as the default for Price Lists without a workflow), the approval also starts a Condition Record job for this Price List. Not meant to be used directly in Groovy.
      Specified by:
      onApproved in interface Approvable
      Parameters:
      approver - The user whose approval completed the workflow.
      objectService - Used to raise the ITEM_APPROVED_PL event.
    • onNoApprovalRequired

      public void onNoApprovalRequired(User approver, WorkflowDTO workflowDTO, PersistedObjectService objService, ApprovalActionsService approvalActionsService)
      Called by the workflow engine when this Price List was submitted but the configured workflow logic determined that no approval step applies. Records approver as the submitter, stamps getSubmitDate(), then runs the same completion logic as onApproved(User, PersistedObjectService) and notifies approvalActionsService, which starts a Condition Record job for this Price List when a Condition Record logic is configured (as the workflow's default, or as the default for Price Lists when no workflow logic applies). Not meant to be used directly in Groovy.
      Specified by:
      onNoApprovalRequired in interface Approvable
      Parameters:
      approver - The user whose action triggered the no-approval-required path.
      workflowDTO - The workflow definition that determined no approval was required.
      objService - Passed through to onApproved(User, PersistedObjectService).
      approvalActionsService - Notified of the no-approval-required completion.
    • typeName

      public String typeName()
      The lowercased type identifier for this Approvable, used as the unique name of its WorkflowFormula and as the Groovy binding name in workflow logics.
      Specified by:
      typeName in interface Approvable
      Returns:
      "pricelist".
    • processPostLoad

      public void processPostLoad(PersistedObjectService objService)
      Invoked by service-layer code right after this Price List is loaded, before further processing or calculation, to initialize any transient state. This is not a JPA @PostLoad callback. This implementation does nothing. Not meant to be used directly in Groovy.
      Specified by:
      processPostLoad in interface Approvable
      Parameters:
      objService - Unused by this implementation; present for the Approvable contract.
    • getWorkflowStatus

      public Workflow.WorkflowStatus getWorkflowStatus()
      This Price List's current position in its approval workflow.
      Specified by:
      getWorkflowStatus in interface Approvable
      Returns:
      The current WorkflowStatus, or null if this Price List has never been submitted for approval.
      See Also:
    • setWorkflowStatus

      public void setWorkflowStatus(Workflow.WorkflowStatus workflowStatus)
      Sets this Price List's workflow status. Possible values: DRAFT, SUBMITTED, DENIED, APPROVED, NO_APPROVAL_REQUIRED, WITHDRAWN and INVALIDATED. The approval workflow sets it. Not meant to be used directly in Groovy.
      Specified by:
      setWorkflowStatus in interface Approvable
      Parameters:
      workflowStatus - The workflow status to assign.
      See Also:
    • getUniqueNamePrefix

      public String getUniqueNamePrefix(PersistedObjectService objService)
      The short code prefix combined with this Price List's id to build its display/unique name (for example "PL-123").
      Specified by:
      getUniqueNamePrefix in interface Approvable
      Parameters:
      objService - Unused by this implementation; present for the Approvable contract.
      Returns:
      "PL".
    • getSubmittedByName

      public String getSubmittedByName()
      The login name of the user who submitted this Price List for approval, cached at submission time by onSubmit(User, PersistedObjectService) for display without an extra join. May become stale if the referenced user's login name later changes.
      Specified by:
      getSubmittedByName in interface Approvable
      Returns:
      The submitter's login name, or null if this Price List has not been submitted.
    • getHasCriticalAlert

      public boolean getHasCriticalAlert()
      Whether at least one line item raised a critical alert (an alert configured on a logic element, set at the end of the calculation). While true, the Price List cannot be submitted for approval unless the allowPLSubmitWithCriticalAlert application property is enabled. A calculation failure does not set this flag.
      Returns:
      true if a line item has a critical alert, false otherwise.
    • setHasCriticalAlert

      public void setHasCriticalAlert(Boolean hasCriticalAlert)
      Set by the calculation. Not meant to be used directly in Groovy.
      Parameters:
      hasCriticalAlert - Whether a line item has a critical alert.
    • getWfLastExecutedByName

      public String getWfLastExecutedByName()
      The login name of the last user who approved a workflow step of this Price List, cached for display without an extra join. A denial does not update it. May become stale if that user's login name changes later.
      Specified by:
      getWfLastExecutedByName in interface Approvable
      Returns:
      The last approving user's login name, or null if no step has been approved yet.
    • getApprovedByName

      public String getApprovedByName()
      The login name of the last user who approved a workflow step, derived from getWorkflowStatus(), getApprovalState() and getWfLastExecutedByName(). Also set while the Price List is still SUBMITTED after an intermediate approval step.
      Specified by:
      getApprovedByName in interface Approvable
      Returns:
      The approver's login name, or null if no step has been approved.
    • getDeniedByName

      public String getDeniedByName()
      The login name to show for a denied Price List, derived from getWorkflowStatus(), getApprovalState() and getWfLastExecutedByName(). The denying user is not recorded, so this is the last user who approved a step before the denial.
      Specified by:
      getDeniedByName in interface Approvable
      Returns:
      The login name of the last approving user of a denied Price List, or null if the Price List is not denied or the first step was denied.
    • setApprovedByName

      public void setApprovedByName(String approvedByName)
      No-op setter kept only so the JSON deserializer accepts an incoming approvedByName field; the value is always derived by getApprovedByName() and cannot be set directly.
      Parameters:
      approvedByName - Ignored.
    • setDeniedByName

      public void setDeniedByName(String deniedByName)
      No-op setter kept only so the JSON deserializer accepts an incoming deniedByName field; the value is always derived by getDeniedByName() and cannot be set directly.
      Parameters:
      deniedByName - Ignored.
    • getSubmitDate

      public LocalDateTime getSubmitDate()
      The date and time this Price List was last submitted for approval, set by onSubmit(User, PersistedObjectService).
      Returns:
      The submission date and time, or null if this Price List has not been submitted.
    • submitDate

      public String submitDate()
      The submission date and time formatted for display, using the partition's configured date-time pattern. Serialized under the JSON property submitDate in place of the raw getSubmitDate() value.
      Returns:
      The formatted submission date and time, or null if this Price List has not been submitted.
    • setSubmitDate

      public void setSubmitDate(LocalDateTime submitDate)
      Sets the submission date. Set by onSubmit(User, PersistedObjectService). Not meant to be used directly in Groovy.
      Parameters:
      submitDate - The date and time this Price List was submitted for approval, or null to clear it.
    • setItemApprovalReason

      public void setItemApprovalReason(Map<String,String> reasons)
      Intended to record per-item approval reasons when this Price List's approval is decided at header level but reasons should be shown on individual line items. Not implemented: currently a no-op.
      Specified by:
      setItemApprovalReason in interface Approvable
      Parameters:
      reasons - Line item typed id to reason text. Currently ignored.
    • getApprovalRequiredEmailAttachments

      public List<?> getApprovalRequiredEmailAttachments()
      Attachments to include in approval-required emails sent for this Price List. Not currently used for Price Lists.
      Specified by:
      getApprovalRequiredEmailAttachments in interface Approvable
      Returns:
      null.
    • fillSubmitter

      protected void fillSubmitter(User submitter)
    • fillWfLastExecutedByName

      protected void fillWfLastExecutedByName(User executedByName)
    • updatePricelistHeader

      public void updatePricelistHeader(PersistedObjectService objService)
      Recounts this Price List's line items and stores the count as its header-level item count. Runs at the end of a calculation, after line items are deleted through the Price List commands, and when a Price List is created by merging or by converting a Live Price Grid. Line items changed by api.add or api.update do not trigger it; call api.updateCalculableObjectHeader("PL", pricelistId) to refresh the count from a script. Not meant to be used directly in Groovy.
      Parameters:
      objService - Used to count this Price List's line items.
    • resetWorkflow

      public void resetWorkflow(PersistedObjectService objService)
      Reverts this Price List to an unsubmitted state: clears getWorkflowStatus(), sets getApprovalState() back to NOT_APPROVED, clears the cached submitter and last-executor names and the approval date, and raises an ITEM_PL_REVOKED event. Not meant to be used directly in Groovy.
      Parameters:
      objService - Used to raise the ITEM_PL_REVOKED event.
    • getDefaultTrackerType

      public JobStatusTracker.TrackerType getDefaultTrackerType()
      The kind of background job tracker used by default when this Price List's calculation runs. Not meant to be used directly in Groovy.
      Specified by:
      getDefaultTrackerType in class AbstractCalculable
      Returns:
      TrackerType.PRICELIST.
    • itemsStateChanged

      public void itemsStateChanged(PersistedObjectService objService)
      Refreshes the header-level item count via updatePricelistHeader(PersistedObjectService), after the superclass handling. Called by api.updateCalculableObjectHeader("PL", pricelistId) (available in Calculated Field Sets, Calculation Flows and direct logic execution). Not meant to be used directly in Groovy.
      Overrides:
      itemsStateChanged in class CalculableObject
      Parameters:
      objService - Passed through to the superclass and to updatePricelistHeader(PersistedObjectService).
    • getCreatedByName

      public String getCreatedByName()
      The login name of the user who created this Price List, cached at creation time for display without an extra join. May become stale if the referenced user's login name later changes.
      Specified by:
      getCreatedByName in interface NamedChangeTracker
      Returns:
      The creator's login name, or null if not recorded.
    • setCreatedByName

      public void setCreatedByName(String createdByName)
      Sets the creator's login name. The framework sets it when the Price List is created. Not meant to be used directly in Groovy.
      Specified by:
      setCreatedByName in interface NamedChangeTracker
      Parameters:
      createdByName - The login name of the user who created this Price List.
    • getLastUpdateByName

      public String getLastUpdateByName()
      The login name of the user who last updated this Price List, cached at update time for display without an extra join. May become stale if the referenced user's login name later changes.
      Returns:
      The last-updating user's login name, or null if not recorded.
    • setLastUpdateByName

      public void setLastUpdateByName(String lastUpdateByName)
      Sets the login name of the last updating user. The framework overwrites it on every update. Not meant to be used directly in Groovy.
      Specified by:
      setLastUpdateByName in interface NamedChangeTracker
      Parameters:
      lastUpdateByName - The login name of the user who last updated this Price List.
    • onPreProcessing

      public boolean onPreProcessing(PersistedObjectService objService, Map<String,Object> values, LocalDateTime targetDate)
      Called before this Price List is created, updated, or deleted through the API (for example api.update("PL", ...)). A good place to normalize the incoming values before they are applied. Not meant to be used directly in Groovy.
      Specified by:
      onPreProcessing in interface APIModifiable
      Parameters:
      objService -
      values - The field values about to be applied to this Price List.
      targetDate - The target date of the operation.
      Returns:
      true to allow the operation to proceed. This implementation always returns true; returning false would abort the operation.
    • getJobType

      public String getJobType()
      The job-type discriminator used for background calculation job naming/routing. Not meant to be used directly in Groovy.
      Specified by:
      getJobType in interface JobSettingsProvider
      Returns:
      This Price List's type code, "PL".
    • isShotgunEnabled

      public boolean isShotgunEnabled(PersistedObjectService txn)
      Whether "shotgun mode" (distributed calculation spread across multiple worker agents/pods rather than run sequentially) is allowed for this Price List at all, controlled by the shotgun mode setting in getPricelistConfiguration(). Not meant to be used directly in Groovy.
      Specified by:
      isShotgunEnabled in interface JobSettingsProvider
      Parameters:
      txn - Unused by this implementation; present for the JobSettingsProvider contract.
      Returns:
      true if shotgun mode is enabled in this Price List's configuration, false otherwise.
    • getShotgunThreshold

      public int getShotgunThreshold(PersistedObjectService objService, JobStatusTracker jst)
      The minimum job size (see jobSize(PersistedObjectService, JobStatusTracker, int)) above which the calculation framework switches into shotgun (distributed) mode instead of a single sequential run, when isShotgunEnabled(PersistedObjectService) allows it. The threshold is set for the whole instance (default 5000) and can be overridden per partition by an application property. Not meant to be used directly in Groovy.
      Specified by:
      getShotgunThreshold in interface JobSettingsProvider
      Parameters:
      objService - Used to resolve the configured threshold.
      jst - The job status tracker for the current calculation run.
      Returns:
      The shotgun mode threshold for this run.
    • jobSize

      public int jobSize(PersistedObjectService objectService, JobStatusTracker jst, int runNumber)
      The size of this Price List's current calculation run: the number of line items the run is expected to process. Used by the calculation framework both to decide whether to switch into shotgun (distributed) mode (compared against getShotgunThreshold(PersistedObjectService, JobStatusTracker)) and, once in shotgun mode, to size the number of worker pods. Not meant to be used directly in Groovy.

      Resolution order: an explicit distributed job size job parameter, then (for a recalculation run) the count of items already marked for recalculation, then a tainted/dirty/full-recalculation item count, then, for a Pricelist.ProcessingMode.NEW_REVISION or Pricelist.ProcessingMode.NEW_REVISION_BYCRITERIA run, the previous Price List's item count, then the already-known item count, and finally a fresh count derived from the configured product selection.

      Specified by:
      jobSize in interface JobSettingsProvider
      Parameters:
      objectService - Used to count line items when the size cannot be resolved from the tracker or from the already-known item count.
      jst - The job status tracker for the current calculation run, supplying job parameters and properties.
      runNumber - The current pass number of a multi-pass calculation (0 for the first pass).
      Returns:
      The number of line items this run is expected to process.
    • getAgentOption1

      public Object getAgentOption1(PersistedObjectService objService, JobStatusTracker jst, int runNumber)
      A flag passed to the calculation agent. Not meant to be used directly in Groovy.

      For TrackerType.PRICELIST: true puts the agent into recalculation mode, in which existing line items are recalculated in place (all of them, the tainted ones, the mass-updated ones or the given ids) instead of being generated from the product selection. It is true when the job has ids to recalculate or has the tainted, full-list or mass-update recalculation flag set. For TrackerType.PRICELIST_DIRTY: true while runNumber is below MAX_DIRTY_RUNS. For any other tracker type: false.

      Specified by:
      getAgentOption1 in interface JobSettingsProvider
      Parameters:
      objService - Unused by this implementation; present for the JobSettingsProvider contract.
      jst - The job status tracker for the current calculation run, supplying job parameters and the tracker type.
      runNumber - The current pass number, used for the dirty-items tracker case.
      Returns:
      A Boolean whose meaning depends on jst's tracker type, as described above.