Click or drag to resize

Server Business Rules

This topic discusses ShipExec server side business rules.

[TODO]

Business Rule Metadata

Business Rule Metadata is a required attribute on the business rule class. It is used by ShipExec to provide information about the business rule as well as assign a specific company to the business rule. The metadata is used during the load business rule process in the configuration tool.

C#
[BusinessRuleMetadata(Author = "Joe", AuthorEmail = "joe@somecompany.com", Description = "Joe's Business Rules", Name = "Joe's Business Rules", Version = "1.0", CompanyId = "00000000-0000-0000-0000-000000000000")]

Property

Description

Author

This metadata property is required and should contain the author of the business rule. It is displayed in Management Studio.

AuthorEmail

This metadata property is required and should contain the email address of the author. It is displayed in Management Studio.

CompanyId

This metadata property is required and should contain the company id (guid) for the business rule. This is used during the load business rule process in the configuration tool to add the business rule to the company's configuration. It is displayed in Management Studio.

Description

This metadata property is optional and is used to describe the business rule class. It is displayed in Management Studio.

Name

This metadata property is required and should contain the display name for the business rule. It is displayed in Management Studio.

Version

This metadata property is required and should contain the version of the business rule. It is displayed in Management Studio.

Business Rule Properties

Business rule properties are set when the business rule class is instantiated and can be used within the business rule methods.

Property

Description

BusinessObjectApi

Business Rule property that contains an instance of a IBusinessObjectApi.

Logger

Business rule property that contains an instance of a ILogger.

Profile

Business rule property that contains an instance of a IProfile.

BusinessRuleSettings

Business rule property that contains a list of BusinessRuleSetting. BusinessRuleSettings are created in ShipExec Management Studio and are passed into the business rule class.

Business Rule Methods

Method

Description

Load Rules

Load

Business rules hook that returns a ShipmentRequest object that can be used by shipping clients.

Sample

Rate Rules

PreRate

Business rule hook that executes before the rate event.

Rate

Business rules hook that can be used to override the Rate event.

PostRate

Business rule hook that executes after the rate event.

Ship Rules

PreShip

Business rule hook that executes before the ship event.

Sample

Ship

Business rules hook that can be used to override the Ship event.

PostShip

Business rule hook that executes after the ship event.

Sample

Print Rules

PrePrint

Business rule hook that executes after the print event.

Sample

Print

Business rule hook that executes after the print event.

PostPrint

Business rule hook that executes after the print event.

Sample

ErrorLabel

Business rules hook that executes when an error occurs while processing a shipment and can be used to return an error label to the shipping client.

Reprocess Rules

PreReprocess

Business rules hook that executes before the Reprocess event.

PostReprocess

Business rules hook that executes after the Reprocess event.

Void Rules

PreVoid

Business rules hook that executes before the Void event.

VoidPackage

Business rules hook that can be used to override the Void event.

PostVoid

Business rules hook that executes after the Void event.

Group Rules

PreCloseGroup

Business rules hook that executes before the CloseGroup event.

PostCloseGroup

Business rules hook that executes after the CloseGroup event.

PreCreateGroup

Business rules hook that executes before the CreateGroup event.

PostCreateGroup

Business rules hook that executes after the CreateGroup event.

PreModifyGroup

Business rules hook that executes before the ModifyGroup event.

Package List Rules

PreModifyPackageList

Business rules hook that executes before the ModifyPackageList event.

PostModifyPackageList

Business rules hook that executes after the ModifyPackageList event.

Manifest Rules

PreCloseManifest

Business rules hook that executes before the CloseManifest event.

CloseManifest

Business rules hook that can be used to override the CloseManifest event.

PostCloseManifest

Business rules hook that executes after CloseManifest event.

Transmit Rules

PreTransmit

Business rules hook that executes before the Transmit event.

Transmit

Business rules hook that can be used to override the Transmit event.

PostTransmit

Business rules hook that executes after the Transmit event.

Batch Rules

GetBatchReferences

Business rules hook that sets the list of batch references displayed on the Batch screen in the shipping client.

LoadBatch

Business rules hook that loads a batch.

ParseBatchFile

Business rules hook to parse a custom file of batch records.

PreProcessBatch

Business rules hook that executes before the ProcessBatch event.

PostProcessBatch

Business rules hook that executes after the ProcessBatch event.

Pack Rules

PrePack

Business rules hook that executes before the Pack event.

PostPack

Business rules hook that executes after a Pack event.

PrePackRate

Business rules hook that executes before the PackRate event.

PostPackRate

Business rules hook that executes after a PackRate event.

Address Validation Rules

PreAddressValidation

Business rules hook that executes before the AddressValidation event.

AddressValidation

Business rules hook that can be used to override the AddressValidation event.

PostAddressValidation

Business rules hook that executes after the AddressValidation event.

Collection Rules

GetBoxTypes

Business rules hook that sets the list of box types displayed on the shipping screen in the shipping client.

GetCommodityContents

Business rules hook that sets the list of available commodity contents that are available on the commodities screen in the shipping client.

GetHazmatContents

Business rules hook that sets the list of available commodity contents that are available on the commodities screen in the shipping client.

Miscellaneous Rules

UserMethod

Business rule hook that exposes a custom method available to the shipping client to send messages to server side business rules.

See Also